Add forgotten files, many updates concerning turrets and shields

This commit is contained in:
2021-11-05 19:58:55 +00:00
parent 2c768845b2
commit 5a52b646e1
21 changed files with 380 additions and 34 deletions
+10 -4
View File
@@ -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