LambdaHack-0.11.0.1: A game engine library for tactical squad ASCII roguelike dungeon crawlers

Safe Haskell | None
Language | Haskell2010

Game.LambdaHack.Common.Area

Description

Rectangular areas of levels and their basic operations.

Synopsis

- data Area
- toArea :: (X, Y, X, Y) -> Maybe Area
- fromArea :: Area -> (X, Y, X, Y)
- spanArea :: Area -> (Point, X, Y)
- trivialArea :: Point -> Area
- isTrivialArea :: Area -> Bool
- inside :: Area -> Point -> Bool
- shrink :: Area -> Maybe Area
- expand :: Area -> Area
- middlePoint :: Area -> Point
- areaInnerBorder :: Area -> [Point]
- sumAreas :: Area -> Area -> Area
- punindex :: X -> Int -> Point

# Documentation

data Area Source #

The type of areas. The bottom left and the top right points.

#### Instances

Instances details

Binary Area Source # |
Instance details Defined in Game.LambdaHack.Common.Area Methods put :: Area -> Put Source # get :: Get Area Source # putList :: [Area] -> Put Source #
Show Area Source # |
Instance details Defined in Game.LambdaHack.Common.Area Methods showsPrec :: Int -> Area -> ShowS Source # show :: Area -> String Source # showList :: [Area] -> ShowS Source #
Eq Area Source # |
Instance details Defined in Game.LambdaHack.Common.Area Methods (==) :: Area -> Area -> Bool Source # (/=) :: Area -> Area -> Bool Source #

toArea :: (X, Y, X, Y) -> Maybe Area Source #

Checks if it's an area with at least one field.

fromArea :: Area -> (X, Y, X, Y) Source #

spanArea :: Area -> (Point, X, Y) Source #

trivialArea :: Point -> Area Source #

isTrivialArea :: Area -> Bool Source #

inside :: Area -> Point -> Bool Source #

Checks that a point belongs to an area.

shrink :: Area -> Maybe Area Source #

Shrink the given area on all fours sides by the amount.

expand :: Area -> Area Source #

middlePoint :: Area -> Point Source #

areaInnerBorder :: Area -> [Point] Source #

sumAreas :: Area -> Area -> Area Source #

punindex :: X -> Int -> Point Source #