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
+5 -4
View File
@@ -12,17 +12,18 @@ import qualified IntMapHelp as IM
deleteWallID :: Int -> World -> World
deleteWallID i w =
w & cWorld . walls %~ IM.delete i
w & cWorld . lWorld . walls %~ IM.delete i
& deleteWallFromZones wl
where
wl = _walls (_cWorld w) IM.! i
--wl = _walls (_cWorld w) IM.! i
wl = w ^?! cWorld . lWorld . walls . ix i
deleteWall :: Wall -> World -> World
deleteWall wl =
(cWorld . walls %~ IM.delete i)
(cWorld . lWorld . walls %~ IM.delete i)
. deleteWallFromZones wl
where
i = _wlID wl
deleteWallIDs :: IS.IntSet -> World -> World
deleteWallIDs is w = foldl' (flip deleteWall) w $ IM.restrictKeys (_walls (_cWorld w)) is
deleteWallIDs is w = foldl' (flip deleteWall) w $ IM.restrictKeys (w ^. cWorld . lWorld . walls) is