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

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Server.DungeonGen.Area

Description

Rectangular areas of levels and their basic operations.

Synopsis

Documentation

data Area Source #

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

Instances
Eq Area Source # 
Instance details

Defined in Game.LambdaHack.Server.DungeonGen.Area

Methods

(==) :: Area -> Area -> Bool #

(/=) :: Area -> Area -> Bool #

Show Area Source # 
Instance details

Defined in Game.LambdaHack.Server.DungeonGen.Area

Methods

showsPrec :: Int -> Area -> ShowS #

show :: Area -> String #

showList :: [Area] -> ShowS #

Binary Area Source # 
Instance details

Defined in Game.LambdaHack.Server.DungeonGen.Area

Methods

put :: Area -> Put #

get :: Get Area #

putList :: [Area] -> Put #

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 #

mkFixed Source #

Arguments

:: (X, Y)

maximum size

-> Area

the containing area, not the room itself

-> Point

the center point

-> Area 

grid :: EnumMap Point (GroupName PlaceKind) -> [Point] -> (X, Y) -> Area -> ((X, Y), EnumMap Point SpecialArea) Source #

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

When a list of fixed centers (some important points inside) of (non-overlapping) areas is given, incorporate those, with as little disruption, as possible.

shrink :: Area -> Maybe Area Source #

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