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
+24
View File
@@ -0,0 +1,24 @@
module Dodge.Wall.Zone
where
import Dodge.Data
import Geometry
import Dodge.Zone
import Dodge.Base
import Control.Lens
import Data.Foldable
zoneOfWall :: Wall -> [(Int,Int)]
zoneOfWall wl
| uncurry dist wlline <= 2*zoneSize = [zoneOfPoint $ uncurry pHalf wlline ]
| otherwise = map zoneOfPoint $ uncurry (divideLine zoneSize) wlline
where
wlline = _wlLine wl
insertWallInZones :: Wall -> World -> World
insertWallInZones wl = wallsZone . znObjects
%~ flip (foldl' (flip $ \(a,b) -> insertIMInZone a b (_wlID wl) wl)) (zoneOfWall wl)
deleteWallFromZones :: Wall -> World -> World
deleteWallFromZones wl = wallsZone . znObjects
%~ flip (foldl' (flip $ \(a,b) -> deleteIMInZone a b (_wlID wl))) (zoneOfWall wl)