Restrict some arguments

This commit is contained in:
2022-10-28 22:00:38 +01:00
parent d496c4c523
commit 14e2b5cf8f
6 changed files with 55 additions and 53 deletions
+7 -6
View File
@@ -1,17 +1,18 @@
module Dodge.Zoning.World where
module Dodge.Zoning.World
( zoneOfSight
) where
import Dodge.Data.World
import Dodge.Data.CamPos
import Geometry.Data
import Control.Lens
zoneOfSight :: Float -> World -> [Int2]
zoneOfSight :: Float -> CamPos -> [Int2]
zoneOfSight s w =
[ V2 a b
| a <- [minimum xs .. maximum xs]
, b <- [minimum ys .. maximum ys]
]
where
(xs, ys) = unzip $ map sizeZoneOfPoint $ w ^. cWorld . lWorld . camPos . camBoundBox
(xs, ys) = unzip $ map sizeZoneOfPoint $ w ^. camBoundBox
sizeZoneOfPoint (V2 x y) = (f x, f y)
where
f = floor . (/ s)
f = floor . (/ s)