Improve machines, tweak wall ids
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
module Dodge.Wall.Delete
|
||||
( deleteWallIDs
|
||||
) where
|
||||
import Dodge.Data
|
||||
import Dodge.Zone
|
||||
import Geometry
|
||||
|
||||
import Control.Lens
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
import qualified Data.IntSet as IS
|
||||
deleteWall :: Wall -> World -> World
|
||||
deleteWall wl = (walls %~ IM.delete i)
|
||||
. (wallsZone . znObjects . ix x . ix y %~ IM.delete i)
|
||||
where
|
||||
(x,y) = zoneOfPoint $ uncurry pHalf (_wlLine wl)
|
||||
i = _wlID wl
|
||||
|
||||
deleteWallIDs :: IS.IntSet -> World -> World
|
||||
deleteWallIDs is w = foldr deleteWall w $ IM.restrictKeys (_walls w) is
|
||||
Reference in New Issue
Block a user