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