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
+4 -4
View File
@@ -10,16 +10,16 @@ import qualified IntMapHelp as IM
import qualified Data.IntSet as IS
deleteWallID :: Int -> World -> World
deleteWallID i w = w & walls %~ IM.delete i
deleteWallID i w = w & cWorld . walls %~ IM.delete i
& deleteWallFromZones wl
where
wl = _walls w IM.! i
wl = _walls (_cWorld w) IM.! i
deleteWall :: Wall -> World -> World
deleteWall wl = (walls %~ IM.delete i)
deleteWall wl = (cWorld . walls %~ IM.delete i)
. deleteWallFromZones wl
where
i = _wlID wl
deleteWallIDs :: IS.IntSet -> World -> World
deleteWallIDs is w = foldr deleteWall w $ IM.restrictKeys (_walls w) is
deleteWallIDs is w = foldr deleteWall w $ IM.restrictKeys (_walls (_cWorld w)) is