Separate out concrete part of world

This commit is contained in:
2022-07-25 12:10:50 +01:00
parent 3354d108be
commit b2efbd2b3e
134 changed files with 933 additions and 930 deletions
+5 -5
View File
@@ -11,12 +11,12 @@ import qualified IntMapHelp as IM
doWdBl :: WdBl -> World -> Bool
doWdBl wb w = case wb of
WdBlConst bl -> bl
WdTrig i -> fromMaybe False $ w ^? triggers . ix i
WdTrig i -> fromMaybe False $ w ^? cWorld . triggers . ix i
WdBlDoorMoving i -> fromMaybe False $ do
dr <- w ^? doors . ix i
dr <- w ^? cWorld . doors . ix i
return (DoorHalfway == _drStatus dr)
WdBlCrFilterNearPoint r p t -> any (crNearPoint r p) (IM.filter (doCrBl t) (_creatures w))
WdBlBtOn btid -> _btState (_buttons w IM.! btid) == BtOn -- unsafe
WdBlBtNotOff btid -> _btState (_buttons w IM.! btid) /= BtOff -- unsafe
WdBlCrFilterNearPoint r p t -> any (crNearPoint r p) (IM.filter (doCrBl t) (_creatures (_cWorld w)))
WdBlBtOn btid -> _btState (_buttons (_cWorld w) IM.! btid) == BtOn -- unsafe
WdBlBtNotOff btid -> _btState (_buttons (_cWorld w) IM.! btid) /= BtOff -- unsafe
WdBlNegate x -> not $ doWdBl x w