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

Safe Haskell | None
Language | Haskell2010

Game.LambdaHack.Content.PlaceKind

Contents

- Internal operations

Description

The type of place kinds. Every room in the game is an instantiated place kind.

Synopsis

- data PlaceKind = PlaceKind {
  - pname :: Text
  - pfreq :: Freqs PlaceKind
  - prarity :: Rarity
  - pcover :: Cover
  - pfence :: Fence
  - ptopLeft :: [Text]
  - plegendDark :: EnumMap Char (GroupName TileKind)
  - plegendLit :: EnumMap Char (GroupName TileKind)
  }
- makeData :: ContentData TileKind -> [PlaceKind] -> [GroupName PlaceKind] -> [GroupName PlaceKind] -> ContentData PlaceKind
- data Cover
  - = CAlternate
  - | CStretch
  - | CReflect
  - | CVerbatim
  - | CMirror
- data Fence
  - = FWall
  - | FFloor
  - | FGround
  - | FNone
- data PlaceEntry
  - = PEntry (ContentId PlaceKind)
  - | PAround (ContentId PlaceKind)
  - | PExists (ContentId PlaceKind)
- deadEndId :: ContentId PlaceKind
- overridePlaceKind :: [(Char, GroupName TileKind)] -> PlaceKind -> PlaceKind
- override2PlaceKind :: [(Char, GroupName TileKind)] -> [(Char, GroupName TileKind)] -> PlaceKind -> PlaceKind
- validateSingle :: ContentData TileKind -> PlaceKind -> [Text]
- validateAll :: [PlaceKind] -> ContentData PlaceKind -> [Text]

# Documentation

data PlaceKind Source #

Parameters for the generation of small areas within a dungeon level.

Constructors

PlaceKind |

Fields

- pname :: Text

  short description, singular or plural

- pfreq :: Freqs PlaceKind

  frequency within groups

- prarity :: Rarity

  rarity on given depths

- pcover :: Cover

  how to fill whole place using the corner

- pfence :: Fence

  whether to fence place with solid border

- ptopLeft :: [Text]

  plan of the top-left corner of the place

- plegendDark :: EnumMap Char (GroupName TileKind)

  dark legend

- plegendLit :: EnumMap Char (GroupName TileKind)

  lit legend

#### Instances

Instances details

Show PlaceKind Source # |
Instance details Defined in Game.LambdaHack.Content.PlaceKind Methods showsPrec :: Int -> PlaceKind -> ShowS Source # show :: PlaceKind -> String Source # showList :: [PlaceKind] -> ShowS Source #

makeData :: ContentData TileKind -> [PlaceKind] -> [GroupName PlaceKind] -> [GroupName PlaceKind] -> ContentData PlaceKind Source #

data Cover Source #

A method of filling the whole area (except for CVerbatim and CMirror, which are just placed in the middle of the area) by transforming a given corner.

Constructors

CAlternate | reflect every other corner, overlapping 1 row and column
CStretch | fill symmetrically 4 corners and stretch their borders
CReflect | tile separately and symmetrically quarters of the place
CVerbatim | just build the given interior, without filling the area
CMirror | build the given interior in one of 4 mirrored variants

#### Instances

Instances details

Show Cover Source # |
Instance details Defined in Game.LambdaHack.Content.PlaceKind Methods showsPrec :: Int -> Cover -> ShowS Source # show :: Cover -> String Source # showList :: [Cover] -> ShowS Source #
Eq Cover Source # |
Instance details Defined in Game.LambdaHack.Content.PlaceKind Methods (==) :: Cover -> Cover -> Bool Source # (/=) :: Cover -> Cover -> Bool Source #

data Fence Source #

The choice of a fence type for the place.

Constructors

FWall | put a solid wall fence around the place
FFloor | leave an empty space, like the room's floor
FGround | leave an empty space, like the cave's ground
FNone | skip the fence and fill all with the place proper

#### Instances

Instances details

Show Fence Source # |
Instance details Defined in Game.LambdaHack.Content.PlaceKind Methods showsPrec :: Int -> Fence -> ShowS Source # show :: Fence -> String Source # showList :: [Fence] -> ShowS Source #
Eq Fence Source # |
Instance details Defined in Game.LambdaHack.Content.PlaceKind Methods (==) :: Fence -> Fence -> Bool Source # (/=) :: Fence -> Fence -> Bool Source #

data PlaceEntry Source #

Places are rooms and other dungeon features, their names can be seen on a level map by aiming at a position that is an entry to the place (an individual entrance point, an approach area around the place or a phantom entry not on the map, but only used for statistics to witness the place exists). Entries are proxies for initial places created on the level (which may be otherwise eradicated by burrowing the walls, etc.) and so used for dungeon statistics. The statistics are presented in the `Dashboard/displace place lore` menu.

Constructors

PEntry (ContentId PlaceKind) |
PAround (ContentId PlaceKind) |
PExists (ContentId PlaceKind) |

#### Instances

Instances details

Binary PlaceEntry Source # |
Instance details Defined in Game.LambdaHack.Content.PlaceKind Methods put :: PlaceEntry -> Put Source # get :: Get PlaceEntry Source # putList :: [PlaceEntry] -> Put Source #
Generic PlaceEntry Source # |

Instance details

Defined in Game.LambdaHack.Content.PlaceKind

Associated Types

type Rep PlaceEntry |

Instance details

Defined in Game.LambdaHack.Content.PlaceKind

type Rep PlaceEntry = D1 ('MetaData "PlaceEntry" "Game.LambdaHack.Content.PlaceKind" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) (C1 ('MetaCons "PEntry" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ContentId PlaceKind))) :+: (C1 ('MetaCons "PAround" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ContentId PlaceKind))) :+: C1 ('MetaCons "PExists" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ContentId PlaceKind)))))

Methods

from :: PlaceEntry -> Rep PlaceEntry x Source #

to :: Rep PlaceEntry x -> PlaceEntry Source #

Show PlaceEntry Source # |
Instance details Defined in Game.LambdaHack.Content.PlaceKind Methods showsPrec :: Int -> PlaceEntry -> ShowS Source # show :: PlaceEntry -> String Source # showList :: [PlaceEntry] -> ShowS Source #
Eq PlaceEntry Source # |
Instance details Defined in Game.LambdaHack.Content.PlaceKind Methods (==) :: PlaceEntry -> PlaceEntry -> Bool Source # (/=) :: PlaceEntry -> PlaceEntry -> Bool Source #
type Rep PlaceEntry Source # |

Instance details

Defined in Game.LambdaHack.Content.PlaceKind

type Rep PlaceEntry = D1 ('MetaData "PlaceEntry" "Game.LambdaHack.Content.PlaceKind" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) (C1 ('MetaCons "PEntry" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ContentId PlaceKind))) :+: (C1 ('MetaCons "PAround" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ContentId PlaceKind))) :+: C1 ('MetaCons "PExists" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ContentId PlaceKind)))))

deadEndId :: ContentId PlaceKind Source #

overridePlaceKind :: [(Char, GroupName TileKind)] -> PlaceKind -> PlaceKind Source #

override2PlaceKind :: [(Char, GroupName TileKind)] -> [(Char, GroupName TileKind)] -> PlaceKind -> PlaceKind Source #

# Internal operations

validateSingle :: ContentData TileKind -> PlaceKind -> [Text] Source #

Catch invalid place kind definitions. In particular, verify that the top-left corner map is rectangular and not empty.

validateAll :: [PlaceKind] -> ContentData PlaceKind -> [Text] Source #

Validate all place kinds.