Safe Haskell | None |
---|

Rectangular areas of levels and their basic operations.

- type Area = (X, Y, X, Y)
- vicinityXY :: Area -> PointXY -> [PointXY]
- vicinityCardinalXY :: Area -> PointXY -> [PointXY]
- insideXY :: PointXY -> Area -> Bool
- normalizeArea :: Area -> Area
- grid :: (X, Y) -> Area -> [(PointXY, Area)]
- validArea :: Area -> Bool
- trivialArea :: Area -> Bool
- expand :: Area -> Int -> Area

# Documentation

All (8 at most) closest neighbours of a point within an area.

All (4 at most) cardinal direction neighbours of a point within an area.

normalizeArea :: Area -> AreaSource

Sort the corners of an area so that the bottom left is the first point.

grid :: (X, Y) -> Area -> [(PointXY, Area)]Source

Divide uniformly a larger area into the given number of smaller areas.

trivialArea :: Area -> BoolSource

Checks if it's an area with exactly one field.