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

Safe Haskell | None
Language | Haskell2010

Game.LambdaHack.Definition.Defs

Description

Basic types for content definitions.

Synopsis

- data GroupName c
- displayGroupName :: GroupName c -> Text
- data ContentId c
- contentIdIndex :: ContentId c -> Int
- type ContentSymbol c = Char
- displayContentSymbol :: ContentSymbol c -> Char
- type X = Int
- type Y = Int
- type Freqs c = [(GroupName c, Int)]
- renameFreqs :: (Text -> Text) -> Freqs c -> Freqs c
- type Rarity = [(Double, Int)]
- linearInterpolation :: Int -> Int -> Rarity -> Int
- data CStore
  - = CGround
  - | COrgan
  - | CEqp
  - | CStash
- ppCStore :: CStore -> (Text, Text)
- ppCStoreIn :: CStore -> Text
- verbCStore :: CStore -> Text
- data SLore
  - = SItem
  - | SOrgan
  - | STrunk
  - | SCondition
  - | SBlast
  - | SEmbed
  - | SBody
- data ItemDialogMode
  - = MStore CStore
  - | MOwned
  - | MSkills
  - | MLore SLore
  - | MPlaces
  - | MFactions
  - | MModes
- ppSLore :: SLore -> Text
- headingSLore :: SLore -> Text
- ppItemDialogMode :: ItemDialogMode -> (Text, Text)
- ppItemDialogModeIn :: ItemDialogMode -> Text
- ppItemDialogModeFrom :: ItemDialogMode -> Text
- loreFromMode :: ItemDialogMode -> SLore
- data Direction
  - = Forward
  - | Backward

# Documentation

data GroupName c Source #

#### Instances

Instances details

Binary (GroupName c) Source # |
Instance details Defined in Game.LambdaHack.Definition.DefsInternal Methods put :: GroupName c -> Put Source # get :: Get (GroupName c) Source # putList :: [GroupName c] -> Put Source #
NFData (GroupName c) Source # |
Instance details Defined in Game.LambdaHack.Definition.DefsInternal Methods rnf :: GroupName c -> () Source #
Show (GroupName c) Source # |
Instance details Defined in Game.LambdaHack.Definition.DefsInternal Methods showsPrec :: Int -> GroupName c -> ShowS Source # show :: GroupName c -> String Source # showList :: [GroupName c] -> ShowS Source #
Eq (GroupName c) Source # |
Instance details Defined in Game.LambdaHack.Definition.DefsInternal Methods (==) :: GroupName c -> GroupName c -> Bool Source # (/=) :: GroupName c -> GroupName c -> Bool Source #
Ord (GroupName c) Source # |

Instance details

Defined in Game.LambdaHack.Definition.DefsInternal

Methods

compare :: GroupName c -> GroupName c -> Ordering Source #

(<) :: GroupName c -> GroupName c -> Bool Source #

(<=) :: GroupName c -> GroupName c -> Bool Source #

(>) :: GroupName c -> GroupName c -> Bool Source #

(>=) :: GroupName c -> GroupName c -> Bool Source #

max :: GroupName c -> GroupName c -> GroupName c Source #

min :: GroupName c -> GroupName c -> GroupName c Source #

Hashable (GroupName c) Source # |
Instance details Defined in Game.LambdaHack.Definition.DefsInternal Methods hashWithSalt :: Int -> GroupName c -> Int Source # hash :: GroupName c -> Int Source #

displayGroupName :: GroupName c -> Text Source #

This does not need to be 1-1, so should not be used in place of the `Eq` instance, etc.

data ContentId c Source #

Content identifiers for the content type `c`.

#### Instances

Instances details

UnboxRepClass (ContentId k) Source # |

Instance details

Defined in Game.LambdaHack.Common.PointArray

Associated Types

type UnboxRep (ContentId k) |
Instance details Defined in Game.LambdaHack.Common.PointArray type UnboxRep (ContentId k) = Word16

Methods

toUnboxRepUnsafe :: ContentId k -> UnboxRep (ContentId k) Source #

fromUnboxRep :: UnboxRep (ContentId k) -> ContentId k Source #

Binary (ContentId c) Source # |
Instance details Defined in Game.LambdaHack.Definition.DefsInternal Methods put :: ContentId c -> Put Source # get :: Get (ContentId c) Source # putList :: [ContentId c] -> Put Source #
Enum (ContentId c) Source # |

Instance details

Defined in Game.LambdaHack.Definition.DefsInternal

Methods

succ :: ContentId c -> ContentId c Source #

pred :: ContentId c -> ContentId c Source #

toEnum :: Int -> ContentId c Source #

fromEnum :: ContentId c -> Int Source #

enumFrom :: ContentId c -> [ContentId c] Source #

enumFromThen :: ContentId c -> ContentId c -> [ContentId c] Source #

enumFromTo :: ContentId c -> ContentId c -> [ContentId c] Source #

enumFromThenTo :: ContentId c -> ContentId c -> ContentId c -> [ContentId c] Source #

Show (ContentId c) Source # |
Instance details Defined in Game.LambdaHack.Definition.DefsInternal Methods showsPrec :: Int -> ContentId c -> ShowS Source # show :: ContentId c -> String Source # showList :: [ContentId c] -> ShowS Source #
Eq (ContentId c) Source # |
Instance details Defined in Game.LambdaHack.Definition.DefsInternal Methods (==) :: ContentId c -> ContentId c -> Bool Source # (/=) :: ContentId c -> ContentId c -> Bool Source #
Ord (ContentId c) Source # |

Instance details

Defined in Game.LambdaHack.Definition.DefsInternal

Methods

compare :: ContentId c -> ContentId c -> Ordering Source #

(<) :: ContentId c -> ContentId c -> Bool Source #

(<=) :: ContentId c -> ContentId c -> Bool Source #

(>) :: ContentId c -> ContentId c -> Bool Source #

(>=) :: ContentId c -> ContentId c -> Bool Source #

max :: ContentId c -> ContentId c -> ContentId c Source #

min :: ContentId c -> ContentId c -> ContentId c Source #

Hashable (ContentId c) Source # |
Instance details Defined in Game.LambdaHack.Definition.DefsInternal Methods hashWithSalt :: Int -> ContentId c -> Int Source # hash :: ContentId c -> Int Source #
type UnboxRep (ContentId k) Source # |
Instance details Defined in Game.LambdaHack.Common.PointArray type UnboxRep (ContentId k) = Word16

contentIdIndex :: ContentId c -> Int Source #

type ContentSymbol c = Char Source #

displayContentSymbol :: ContentSymbol c -> Char Source #

type X = Int Source #

X spacial dimension for points and vectors.

type Y = Int Source #

Y xpacial dimension for points and vectors.

type Freqs c = [(GroupName c, Int)] Source #

For each group that the kind belongs to, denoted by a `GroupName` in the first component of a pair, the second component of a pair shows how common the kind is within the group.

renameFreqs :: (Text -> Text) -> Freqs c -> Freqs c Source #

type Rarity = [(Double, Int)] Source #

Rarity on given depths. The first element of the pair is normally in (0, 10] interval and, e.g., if there are 20 levels, 0.5 represents the first level and 10 the last. Exceptionally, it may be larger than 10, meaning appearance in the dungeon is not possible under normal circumstances and the value remains constant above the interval bound.

linearInterpolation :: Int -> Int -> Rarity -> Int Source #

data CStore Source #

Actor's item stores.

Constructors

CGround |
COrgan |
CEqp |
CStash |

#### Instances

Instances details

Binary CStore Source # |
Instance details Defined in Game.LambdaHack.Definition.Defs Methods put :: CStore -> Put Source # get :: Get CStore Source # putList :: [CStore] -> Put Source #
NFData CStore Source # |
Instance details Defined in Game.LambdaHack.Definition.Defs Methods rnf :: CStore -> () Source #
Bounded CStore Source # |
Instance details Defined in Game.LambdaHack.Definition.Defs Methods minBound :: CStore Source # maxBound :: CStore Source #
Enum CStore Source # |

Instance details

Defined in Game.LambdaHack.Definition.Defs

Methods

succ :: CStore -> CStore Source #

pred :: CStore -> CStore Source #

toEnum :: Int -> CStore Source #

fromEnum :: CStore -> Int Source #

enumFrom :: CStore -> [CStore] Source #

enumFromThen :: CStore -> CStore -> [CStore] Source #

enumFromTo :: CStore -> CStore -> [CStore] Source #

enumFromThenTo :: CStore -> CStore -> CStore -> [CStore] Source #

Generic CStore Source # |

Instance details

Defined in Game.LambdaHack.Definition.Defs

Associated Types

type Rep CStore |

Instance details

Defined in Game.LambdaHack.Definition.Defs

type Rep CStore = D1 ('MetaData "CStore" "Game.LambdaHack.Definition.Defs" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) ((C1 ('MetaCons "CGround" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "COrgan" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "CEqp" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CStash" 'PrefixI 'False) (U1 :: Type -> Type)))

Methods

from :: CStore -> Rep CStore x Source #

to :: Rep CStore x -> CStore Source #

Read CStore Source # |
Instance details Defined in Game.LambdaHack.Definition.Defs Methods readsPrec :: Int -> ReadS CStore Source # readList :: ReadS [CStore] Source # readPrec :: ReadPrec CStore Source # readListPrec :: ReadPrec [CStore] Source #
Show CStore Source # |
Instance details Defined in Game.LambdaHack.Definition.Defs Methods showsPrec :: Int -> CStore -> ShowS Source # show :: CStore -> String Source # showList :: [CStore] -> ShowS Source #
Eq CStore Source # |
Instance details Defined in Game.LambdaHack.Definition.Defs Methods (==) :: CStore -> CStore -> Bool Source # (/=) :: CStore -> CStore -> Bool Source #
Ord CStore Source # |
Instance details Defined in Game.LambdaHack.Definition.Defs Methods compare :: CStore -> CStore -> Ordering Source # (<) :: CStore -> CStore -> Bool Source # (<=) :: CStore -> CStore -> Bool Source # (>) :: CStore -> CStore -> Bool Source # (>=) :: CStore -> CStore -> Bool Source # max :: CStore -> CStore -> CStore Source # min :: CStore -> CStore -> CStore Source #
type Rep CStore Source # |

Instance details

Defined in Game.LambdaHack.Definition.Defs

type Rep CStore = D1 ('MetaData "CStore" "Game.LambdaHack.Definition.Defs" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) ((C1 ('MetaCons "CGround" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "COrgan" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "CEqp" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CStash" 'PrefixI 'False) (U1 :: Type -> Type)))

ppCStore :: CStore -> (Text, Text) Source #

ppCStoreIn :: CStore -> Text Source #

verbCStore :: CStore -> Text Source #

data SLore Source #

Item slot and lore categories.

Constructors

SItem |
SOrgan |
STrunk |
SCondition |
SBlast |
SEmbed |
SBody |

#### Instances

Instances details

Binary SLore Source # |
Instance details Defined in Game.LambdaHack.Definition.Defs Methods put :: SLore -> Put Source # get :: Get SLore Source # putList :: [SLore] -> Put Source #
NFData SLore Source # |
Instance details Defined in Game.LambdaHack.Definition.Defs Methods rnf :: SLore -> () Source #
Bounded SLore Source # |
Instance details Defined in Game.LambdaHack.Definition.Defs Methods minBound :: SLore Source # maxBound :: SLore Source #
Enum SLore Source # |
Instance details Defined in Game.LambdaHack.Definition.Defs Methods succ :: SLore -> SLore Source # pred :: SLore -> SLore Source # toEnum :: Int -> SLore Source # fromEnum :: SLore -> Int Source # enumFrom :: SLore -> [SLore] Source # enumFromThen :: SLore -> SLore -> [SLore] Source # enumFromTo :: SLore -> SLore -> [SLore] Source # enumFromThenTo :: SLore -> SLore -> SLore -> [SLore] Source #
Generic SLore Source # |

Instance details

Defined in Game.LambdaHack.Definition.Defs

Associated Types

type Rep SLore |

Instance details

Defined in Game.LambdaHack.Definition.Defs

type Rep SLore = D1 ('MetaData "SLore" "Game.LambdaHack.Definition.Defs" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) ((C1 ('MetaCons "SItem" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "SOrgan" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "STrunk" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "SCondition" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SBlast" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "SEmbed" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SBody" 'PrefixI 'False) (U1 :: Type -> Type))))

Methods

from :: SLore -> Rep SLore x Source #

to :: Rep SLore x -> SLore Source #

Read SLore Source # |
Instance details Defined in Game.LambdaHack.Definition.Defs Methods readsPrec :: Int -> ReadS SLore Source # readList :: ReadS [SLore] Source # readPrec :: ReadPrec SLore Source # readListPrec :: ReadPrec [SLore] Source #
Show SLore Source # |
Instance details Defined in Game.LambdaHack.Definition.Defs Methods showsPrec :: Int -> SLore -> ShowS Source # show :: SLore -> String Source # showList :: [SLore] -> ShowS Source #
Eq SLore Source # |
Instance details Defined in Game.LambdaHack.Definition.Defs Methods (==) :: SLore -> SLore -> Bool Source # (/=) :: SLore -> SLore -> Bool Source #
Ord SLore Source # |
Instance details Defined in Game.LambdaHack.Definition.Defs Methods compare :: SLore -> SLore -> Ordering Source # (<) :: SLore -> SLore -> Bool Source # (<=) :: SLore -> SLore -> Bool Source # (>) :: SLore -> SLore -> Bool Source # (>=) :: SLore -> SLore -> Bool Source # max :: SLore -> SLore -> SLore Source # min :: SLore -> SLore -> SLore Source #
type Rep SLore Source # |

Instance details

Defined in Game.LambdaHack.Definition.Defs

type Rep SLore = D1 ('MetaData "SLore" "Game.LambdaHack.Definition.Defs" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) ((C1 ('MetaCons "SItem" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "SOrgan" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "STrunk" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "SCondition" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SBlast" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "SEmbed" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SBody" 'PrefixI 'False) (U1 :: Type -> Type))))

data ItemDialogMode Source #

Constructors

MStore CStore | a leader's store
MOwned | all party's items
MSkills | not items, but determined by leader's items
MLore SLore | not party's items, but all known generalized items
MPlaces | places; not items at all, but definitely a lore
MFactions | factions in this game, with some data from previous
MModes | scenarios; not items at all, but definitely a lore

#### Instances

Instances details

Binary ItemDialogMode Source # |
Instance details Defined in Game.LambdaHack.Definition.Defs Methods put :: ItemDialogMode -> Put Source # get :: Get ItemDialogMode Source # putList :: [ItemDialogMode] -> Put Source #
NFData ItemDialogMode Source # |
Instance details Defined in Game.LambdaHack.Definition.Defs Methods rnf :: ItemDialogMode -> () Source #
Generic ItemDialogMode Source # |

Instance details

Defined in Game.LambdaHack.Definition.Defs

Associated Types

type Rep ItemDialogMode |

Instance details

Defined in Game.LambdaHack.Definition.Defs

type Rep ItemDialogMode = D1 ('MetaData "ItemDialogMode" "Game.LambdaHack.Definition.Defs" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) ((C1 ('MetaCons "MStore" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 CStore)) :+: (C1 ('MetaCons "MOwned" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MSkills" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "MLore" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SLore)) :+: C1 ('MetaCons "MPlaces" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "MFactions" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MModes" 'PrefixI 'False) (U1 :: Type -> Type))))

Methods

from :: ItemDialogMode -> Rep ItemDialogMode x Source #

to :: Rep ItemDialogMode x -> ItemDialogMode Source #

Read ItemDialogMode Source # |
Instance details Defined in Game.LambdaHack.Definition.Defs Methods readsPrec :: Int -> ReadS ItemDialogMode Source # readList :: ReadS [ItemDialogMode] Source # readPrec :: ReadPrec ItemDialogMode Source # readListPrec :: ReadPrec [ItemDialogMode] Source #
Show ItemDialogMode Source # |
Instance details Defined in Game.LambdaHack.Definition.Defs Methods showsPrec :: Int -> ItemDialogMode -> ShowS Source # show :: ItemDialogMode -> String Source # showList :: [ItemDialogMode] -> ShowS Source #
Eq ItemDialogMode Source # |
Instance details Defined in Game.LambdaHack.Definition.Defs Methods (==) :: ItemDialogMode -> ItemDialogMode -> Bool Source # (/=) :: ItemDialogMode -> ItemDialogMode -> Bool Source #
Ord ItemDialogMode Source # |

Instance details

Defined in Game.LambdaHack.Definition.Defs

Methods

compare :: ItemDialogMode -> ItemDialogMode -> Ordering Source #

(<) :: ItemDialogMode -> ItemDialogMode -> Bool Source #

(<=) :: ItemDialogMode -> ItemDialogMode -> Bool Source #

(>) :: ItemDialogMode -> ItemDialogMode -> Bool Source #

(>=) :: ItemDialogMode -> ItemDialogMode -> Bool Source #

max :: ItemDialogMode -> ItemDialogMode -> ItemDialogMode Source #

min :: ItemDialogMode -> ItemDialogMode -> ItemDialogMode Source #

type Rep ItemDialogMode Source # |

Instance details

Defined in Game.LambdaHack.Definition.Defs

type Rep ItemDialogMode = D1 ('MetaData "ItemDialogMode" "Game.LambdaHack.Definition.Defs" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) ((C1 ('MetaCons "MStore" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 CStore)) :+: (C1 ('MetaCons "MOwned" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MSkills" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "MLore" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SLore)) :+: C1 ('MetaCons "MPlaces" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "MFactions" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MModes" 'PrefixI 'False) (U1 :: Type -> Type))))

ppSLore :: SLore -> Text Source #

headingSLore :: SLore -> Text Source #

ppItemDialogMode :: ItemDialogMode -> (Text, Text) Source #

ppItemDialogModeIn :: ItemDialogMode -> Text Source #

ppItemDialogModeFrom :: ItemDialogMode -> Text Source #

loreFromMode :: ItemDialogMode -> SLore Source #

data Direction Source #

Constructors

Forward |
Backward |

#### Instances

Instances details

Binary Direction Source # |
Instance details Defined in Game.LambdaHack.Definition.Defs Methods put :: Direction -> Put Source # get :: Get Direction Source # putList :: [Direction] -> Put Source #
NFData Direction Source # |
Instance details Defined in Game.LambdaHack.Definition.Defs Methods rnf :: Direction -> () Source #
Generic Direction Source # |

Instance details

Defined in Game.LambdaHack.Definition.Defs

Associated Types

type Rep Direction |
Instance details Defined in Game.LambdaHack.Definition.Defs type Rep Direction = D1 ('MetaData "Direction" "Game.LambdaHack.Definition.Defs" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) (C1 ('MetaCons "Forward" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Backward" 'PrefixI 'False) (U1 :: Type -> Type))

Methods

from :: Direction -> Rep Direction x Source #

to :: Rep Direction x -> Direction Source #

Read Direction Source # |
Instance details Defined in Game.LambdaHack.Definition.Defs Methods readsPrec :: Int -> ReadS Direction Source # readList :: ReadS [Direction] Source # readPrec :: ReadPrec Direction Source # readListPrec :: ReadPrec [Direction] Source #
Show Direction Source # |
Instance details Defined in Game.LambdaHack.Definition.Defs Methods showsPrec :: Int -> Direction -> ShowS Source # show :: Direction -> String Source # showList :: [Direction] -> ShowS Source #
Eq Direction Source # |
Instance details Defined in Game.LambdaHack.Definition.Defs Methods (==) :: Direction -> Direction -> Bool Source # (/=) :: Direction -> Direction -> Bool Source #
Ord Direction Source # |

Instance details

Defined in Game.LambdaHack.Definition.Defs

Methods

compare :: Direction -> Direction -> Ordering Source #

(<) :: Direction -> Direction -> Bool Source #

(<=) :: Direction -> Direction -> Bool Source #

(>) :: Direction -> Direction -> Bool Source #

(>=) :: Direction -> Direction -> Bool Source #

max :: Direction -> Direction -> Direction Source #

min :: Direction -> Direction -> Direction Source #

type Rep Direction Source # |
Instance details Defined in Game.LambdaHack.Definition.Defs type Rep Direction = D1 ('MetaData "Direction" "Game.LambdaHack.Definition.Defs" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) (C1 ('MetaCons "Forward" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Backward" 'PrefixI 'False) (U1 :: Type -> Type))