LambdaHack-0.11.0.0: A game engine library for tactical squad ASCII roguelike dungeon crawlers
Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Common.Kind

Description

General content types and operations.

Synopsis

Documentation

data ContentData c Source #

Verified and preprocessed content data of a particular kind.

data COps Source #

Operations for all content types, gathered together.

Warning: this type is not abstract, but its values should not be created ad hoc, even for unit tests, but should be constructed with makeData for each particular content kind, which includes validation, and with speedupItem, etc., to ensure internal consistency.

The emptyCOps is one such valid by construction value of this type, except for the cocave field. It's suitable for bootstrapping and for tests not involving dungeon generation from cave templates.

Instances

Instances details
Eq COps Source # 
Instance details

Defined in Game.LambdaHack.Common.Kind

Methods

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

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

Show COps Source # 
Instance details

Defined in Game.LambdaHack.Common.Kind

Methods

showsPrec :: Int -> COps -> ShowS #

show :: COps -> String #

showList :: [COps] -> ShowS #

emptyCOps :: COps Source #

This is as empty, as possible, but still valid content, except for cocave which is empty and not valid (making it valid would require bloating most other contents).

data ItemSpeedup Source #

Map from an item kind identifier to the mean aspect value for the kind.

okind :: ContentData a -> ContentId a -> a Source #

Content element at given id.

ouniqGroup :: Show a => ContentData a -> GroupName a -> ContentId a Source #

The id of the unique member of a singleton content group.

opick :: Show a => ContentData a -> GroupName a -> (a -> Bool) -> Rnd (Maybe (ContentId a)) Source #

Pick a random id belonging to a group and satisfying a predicate.

ofoldlWithKey' :: ContentData a -> (b -> ContentId a -> a -> b) -> b -> b Source #

Fold strictly over all content a.

ofoldlGroup' :: ContentData a -> GroupName a -> (b -> Int -> ContentId a -> a -> b) -> b -> b Source #

Fold over the given group only.

omapVector :: ContentData a -> (a -> b) -> Vector b Source #

oimapVector :: ContentData a -> (ContentId a -> a -> b) -> Vector b Source #

olength :: ContentData a -> Int Source #

Size of content a.

Operations both internal and used in unit tests