LambdaHack-0.2.14: A roguelike game engine in early development

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Common.Kind

Description

General content types and operations.

Synopsis

Documentation

data Id c Source

Content identifiers for the content type c.

Instances

Bounded (Id c) 
Enum (Id c) 
Eq (Id c) 
Ord (Id c) 
Show (Id c) 
Ix (Id c) 
Binary (Id c) 

data family Speedup a Source

Type family for auxiliary data structures for speeding up content operations.

data Ops a Source

Content operations for the content of type a.

Constructors

Ops 

Fields

okind :: Id a -> a

the content element at given id

ouniqGroup :: Text -> Id a

the id of the unique member of a singleton content group

opick :: Text -> (a -> Bool) -> Rnd (Maybe (Id a))

pick a random id belonging to a group and satisfying a predicate

ofoldrWithKey :: forall b. (Id a -> a -> b -> b) -> b -> b

fold over all content elements of a

ofoldrGroup :: forall b. Text -> (Int -> Id a -> a -> b -> b) -> b -> b

fold over the given group only

obounds :: !(Id a, Id a)

bounds of identifiers of content a

ospeedup :: !(Maybe (Speedup a))

auxiliary speedup components

data COps Source

Operations for all content types, gathered together.

Constructors

COps 

Instances

createOps :: forall a. Show a => ContentDef a -> Ops a Source

Create content operations for type a from definition of content of type a.

stdRuleset :: Ops RuleKind -> RuleKind Source

The standard ruleset used for level operations.

data Tab Source