Commit before unifying positions
This commit is contained in:
@@ -28,16 +28,17 @@ data PSType = PutCrit {_unPutCrit :: Creature}
|
||||
| PutNothing
|
||||
| PutID { _putID :: Int}
|
||||
-- maybe there is a monadic implementation of this?
|
||||
data PlacementSpot = PS
|
||||
{ _psPos :: Point2
|
||||
, _psRot :: Float
|
||||
}
|
||||
data PlacementSpot
|
||||
= PS { _psPos :: Point2 , _psRot :: Float }
|
||||
| PSLnk { _psLinkTest :: (Point2,Float) -> Bool
|
||||
, _psLinkShift :: (Point2,Float) -> (Point2,Float)
|
||||
}
|
||||
data Placement = Placement
|
||||
{ _placementSpot :: PlacementSpot
|
||||
, _psType :: PSType
|
||||
, _idPlacement :: Int -> Maybe Placement
|
||||
}
|
||||
| PlacementPos Point3 (Point3 -> Placement)
|
||||
| PlacementUsingPos Point3 (Point3 -> Placement) -- allows a placement to use a shifted position
|
||||
|
||||
sPS :: Point2 -> Float -> PSType -> Placement
|
||||
sPS p a pt = Placement (PS p a) pt (const Nothing)
|
||||
@@ -58,7 +59,7 @@ jsps0J :: PSType -> Placement -> Maybe Placement
|
||||
jsps0J pst plm = Just $ Placement (PS (V2 0 0) 0) pst $ \_ -> Just plm
|
||||
|
||||
ps0 :: PSType -> (Int -> Maybe Placement) -> Placement
|
||||
ps0 pst = Placement (PS (V2 0 0) 0) pst
|
||||
ps0 = Placement (PS (V2 0 0) 0)
|
||||
|
||||
jps0 :: PSType -> (Int -> Maybe Placement) -> Maybe Placement
|
||||
jps0 pst = Just . Placement (PS (V2 0 0) 0) pst
|
||||
|
||||
Reference in New Issue
Block a user