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
+3 -3
View File
@@ -10,9 +10,9 @@ import Data.Foldable
updateWallDamages :: World -> World
updateWallDamages w =
w
& cWorld . wallDamages .~ IM.empty
& flip (IM.foldlWithKey' f) (_wallDamages (_cWorld w))
& cWorld . lWorld . wallDamages .~ IM.empty
& flip (IM.foldlWithKey' f) (w ^. cWorld . lWorld . wallDamages)
where
f w' k dams = fromMaybe w' $ do
wl <- w' ^? cWorld . walls . ix k
wl <- w' ^? cWorld . lWorld . walls . ix k
return $ foldl' (flip (`damageWall` wl)) w' dams