Add in "linear" lWorld to separate time reversable worlds

This commit is contained in:
2022-10-28 12:24:51 +01:00
parent 5f6bd43599
commit 7e790b7153
130 changed files with 827 additions and 980 deletions
+7 -5
View File
@@ -10,11 +10,13 @@ import qualified IntMapHelp as IM
doWdBl :: WdBl -> World -> Bool
doWdBl wb w = case wb of
WdBlConst bl -> bl
WdTrig i -> fromMaybe False $ w ^? cWorld . triggers . ix i
WdTrig i -> fromMaybe False $ w ^? cWorld . lWorld . triggers . ix i
WdBlDoorMoving i -> fromMaybe False $ do
dr <- w ^? cWorld . doors . ix i
dr <- w ^? cWorld . lWorld . doors . ix i
return (DoorHalfway == _drStatus dr)
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
WdBlCrFilterNearPoint r p t -> any (crNearPoint r p) (IM.filter (doCrBl t) (w ^. cWorld . lWorld . creatures))
--WdBlBtOn btid -> _btState (_buttons (_cWorld w) IM.! btid) == BtOn -- unsafe
WdBlBtOn btid -> (w ^?! cWorld . lWorld . buttons . ix btid . btState) == BtOn -- unsafe
--WdBlBtNotOff btid -> _btState (_buttons (_cWorld w) IM.! btid) /= BtOff -- unsafe
WdBlBtNotOff btid -> (w ^?! cWorld . lWorld . buttons . ix btid . btState) /= BtOff -- unsafe
WdBlNegate x -> not $ doWdBl x w