swarm-0.5.0.0: 2D resource gathering game with programmable robots
LicenseBSD-3-Clause
Safe HaskellSafe-Inferred
LanguageHaskell2010

Swarm.Game.Scenario.Topography.Area

Description

 
Synopsis

Documentation

data AreaDimensions Source #

Height and width of a 2D map region

Constructors

AreaDimensions 

upperLeftToBottomRight :: AreaDimensions -> Location -> Location Source #

Incorporates an offset by -1, since the area is "inclusive" of the lower-right coordinate. Inverse of cornersToArea.

cornersToArea :: Location -> Location -> AreaDimensions Source #

Converts the displacement vector between the two diagonal corners of the rectangle into an AreaDimensions record. Adds one to both dimensions since the corner coordinates are "inclusive". Inverse of upperLeftToBottomRight.

isEmpty :: AreaDimensions -> Bool Source #

Has zero width or height.

getAreaDimensions :: [[a]] -> AreaDimensions Source #

Extracts the dimensions of a map grid.