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

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Server.DungeonGen.Place

Contents

Description

Generation of places from place kinds.

Synopsis

Documentation

data Place Source #

The parameters of a place. All are immutable and rolled and fixed at the time when a place is generated.

Instances
Show Place Source # 
Instance details

Defined in Game.LambdaHack.Server.DungeonGen.Place

Methods

showsPrec :: Int -> Place -> ShowS #

show :: Place -> String #

showList :: [Place] -> ShowS #

Binary Place Source # 
Instance details

Defined in Game.LambdaHack.Server.DungeonGen.Place

Methods

put :: Place -> Put #

get :: Get Place #

putList :: [Place] -> Put #

type TileMapEM = EnumMap Point (ContentId TileKind) Source #

The map of tile kinds in a place (and generally anywhere in a cave). The map is sparse. The default tile that eventually fills the empty spaces is specified in the cave kind specification with cdefTile.

placeCheck Source #

Arguments

:: Area

the area to fill

-> PlaceKind

the place kind to construct

-> Bool 

For CAlternate tiling, require the place be comprised of an even number of whole corners, with exactly one square overlap between consecutive coners and no trimming. For other tiling methods, check that the area is large enough for tiling the corner twice in each direction, with a possible one row/column overlap.

buildPlace Source #

Arguments

:: COps

the game content

-> CaveKind

current cave kind

-> Bool

whether the cave is dark

-> ContentId TileKind

dark fence tile, if fence hollow

-> ContentId TileKind

lit fence tile, if fence hollow

-> AbsDepth

current level depth

-> AbsDepth

absolute depth

-> Int

secret tile seed

-> Area

whole area of the place, fence included

-> Maybe (GroupName PlaceKind)

optional fixed place group

-> Rnd (TileMapEM, Place) 

Given a few parameters, roll and construct a Place datastructure and fill a cave section acccording to it.

buildFenceRnd :: COps -> GroupName TileKind -> Area -> Rnd TileMapEM Source #

Construct a fence around an area, with the given tile group.

Internal operations

interiorArea :: PlaceKind -> Area -> Maybe Area Source #

Calculate interior room area according to fence type, based on the total area for the room and it's fence. This is used for checking if the room fits in the area, for digging up the place and the fence and for deciding if the room is dark or lit later in the dungeon generation process.

olegend :: COps -> GroupName TileKind -> Rnd (EnumMap Char (Int, ContentId TileKind), EnumMap Char (ContentId TileKind)) Source #

Roll a legend of a place plan: a map from plan symbols to tile kinds.

buildFence :: ContentId TileKind -> Area -> TileMapEM Source #

Construct a fence around an area, with the given tile kind.

tilePlace Source #

Arguments

:: Area

the area to fill

-> PlaceKind

the place kind to construct

-> Rnd (EnumMap Point Char) 

Create a place by tiling patterns.