Separate out concrete part of world
This commit is contained in:
+5
-5
@@ -26,7 +26,7 @@ doorMechanism dr w = case mvDir of
|
||||
Just d -> w
|
||||
& flip (IS.foldl' (flip (`translateWallID` d))) (_drWallIDs dr)
|
||||
& moveUpdate
|
||||
& doors . ix drid . drPos . each %~ (+.+ d)
|
||||
& cWorld . doors . ix drid . drPos . each %~ (+.+ d)
|
||||
& maybeClearDoorPaths (_drObstacleType dr) (_drObstructs dr)
|
||||
Nothing -> w
|
||||
where
|
||||
@@ -46,9 +46,9 @@ doorMechanism dr w = case mvDir of
|
||||
dop = snd $ _drOpenPos dr
|
||||
dcp = snd $ _drClosePos dr
|
||||
setStatus
|
||||
| dist dpos dop < 1 = doors . ix drid . drStatus .~ DoorOpen
|
||||
| dist dpos dcp < 1 = doors . ix drid . drStatus .~ DoorClosed
|
||||
| otherwise = doors . ix drid . drStatus .~ DoorHalfway
|
||||
| dist dpos dop < 1 = cWorld . doors . ix drid . drStatus .~ DoorOpen
|
||||
| dist dpos dcp < 1 = cWorld . doors . ix drid . drStatus .~ DoorClosed
|
||||
| otherwise = cWorld . doors . ix drid . drStatus .~ DoorHalfway
|
||||
|
||||
-- TODO use vector instead of list, perhaps also memoisation of rectanglePairs
|
||||
-- TODO update _drPos
|
||||
@@ -70,7 +70,7 @@ doorMechanismStepwise nsteps wlids pss dr w
|
||||
playSound = soundContinue (WallSound drid) (fst $ head pss) slideDoorS (Just 1)
|
||||
toOpen = doWdBl (_drTrigger dr) w
|
||||
setWalls n = playSound (foldl' (&) w (zipWith moveWallID wlids newps))
|
||||
& doors . ix drid . drStatus .~ DoorInt n
|
||||
& cWorld . doors . ix drid . drStatus .~ DoorInt n
|
||||
where
|
||||
newps = uncurry (rectanglePairs 9) (pss !! n)
|
||||
-- it is not at all clear that the zoning selects the correct walls
|
||||
|
||||
Reference in New Issue
Block a user