Get out external function for grid room positions

This commit is contained in:
2025-10-27 17:22:55 +00:00
parent 329fcc237b
commit 323a50ed31
2 changed files with 29 additions and 15 deletions
-10
View File
@@ -1,7 +1,5 @@
module Grid (
gridInPolygon,
gridPoints,
gridPoints'',
latticeXsYs,
) where
@@ -36,13 +34,5 @@ gridPointsOff xoff yoff x nx y ny = map f $ gridPoints' nx ny
where
f (a, b) = V2 (xoff + fromIntegral a * x) (yoff + fromIntegral b * y)
gridPoints :: Float -> Int -> Float -> Int -> [Point2]
gridPoints = gridPointsOff 0 0
gridPoints'' :: Float -> Int -> Float -> Int -> [(Point2, (Int, Int))]
gridPoints'' x nx y ny = map f $ gridPoints' nx ny
where
f (a, b) = (V2 (fromIntegral a * x) (fromIntegral b * y), (a, b))
gridPoints' :: Int -> Int -> [(Int, Int)]
gridPoints' nx ny = [(x, y) | x <- [0 .. nx -1], y <- [0 .. ny -1]]