Add missing file, workaround for placement positions bug

This commit is contained in:
2022-03-08 07:59:36 +00:00
parent 79b5241c32
commit 59e6f433ff
16 changed files with 67 additions and 86 deletions
+3 -1
View File
@@ -39,6 +39,7 @@ data PSType = PutCrit {_unPutCrit :: Creature}
-- add room effect for any placement spot?
data PlacementSpot
= PS { _psPos :: Point2 , _psRot :: Float }
| PSNoShiftCont { _psPos :: Point2 , _psRot :: Float }
| PSPos
{ _psSelect :: RoomPos -> Room -> Maybe (PlacementSpot, RoomPos)
, _psRoomEff :: RoomPos -> Room -> Room
@@ -204,8 +205,9 @@ ps0j pst plmnt = Placement (PS (V2 0 0) 0) pst Nothing (const $ Just plmnt)
psj :: PlacementSpot -> PSType -> Placement -> Placement
psj ps pst plmnt = Placement ps pst Nothing (const $ Just plmnt)
-- the NoShiftCont is necessary when shifting then combining rooms
ps0jPushPS :: PSType -> Placement -> Placement
ps0jPushPS pst plmnt = Placement (PS (V2 0 0) 0) pst Nothing (\p -> Just $ plmnt & plSpot .~ _plSpot p)
ps0jPushPS pst plmnt = Placement (PSNoShiftCont (V2 0 0) 0) pst Nothing (\p -> Just $ plmnt & plSpot .~ _plSpot p)
addPlmnt :: Placement -> Placement -> Placement
addPlmnt pl pl2 = case pl2 of