Add forgotten files, many updates concerning turrets and shields
This commit is contained in:
@@ -1,18 +1,24 @@
|
||||
module Dodge.Wall.Delete
|
||||
( deleteWallIDs
|
||||
, deleteWallID
|
||||
) where
|
||||
import Dodge.Data
|
||||
import Dodge.Zone
|
||||
import Geometry
|
||||
import Dodge.Wall.Zone
|
||||
|
||||
import Control.Lens
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
import qualified Data.IntSet as IS
|
||||
|
||||
deleteWallID :: Int -> World -> World
|
||||
deleteWallID i w = w & walls %~ IM.delete i
|
||||
& deleteWallFromZones wl
|
||||
where
|
||||
wl = _walls w IM.! i
|
||||
|
||||
deleteWall :: Wall -> World -> World
|
||||
deleteWall wl = (walls %~ IM.delete i)
|
||||
. (wallsZone . znObjects . ix x . ix y %~ IM.delete i)
|
||||
. deleteWallFromZones wl
|
||||
where
|
||||
(x,y) = zoneOfPoint $ uncurry pHalf (_wlLine wl)
|
||||
i = _wlID wl
|
||||
|
||||
deleteWallIDs :: IS.IntSet -> World -> World
|
||||
|
||||
Reference in New Issue
Block a user