Add in "linear" lWorld to separate time reversable worlds
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user