| Safe Haskell | None |
|---|
Game.LambdaHack.Common.Kind
Description
General content types and operations.
- data Id c
- sentinelId :: Id c
- data family Speedup a
- data Ops a = Ops {}
- data COps = COps {}
- createOps :: forall a. Show a => ContentDef a -> Ops a
- stdRuleset :: Ops RuleKind -> RuleKind
- data Array i c
- (!) :: Ix i => Array i c -> i -> Id c
- (//) :: Ix i => Array i c -> [(i, Id c)] -> Array i c
- listArray :: Ix i => (i, i) -> [Id c] -> Array i c
- array :: Ix i => (i, i) -> [(i, Id c)] -> Array i c
- bounds :: Ix i => Array i c -> (i, i)
- foldlArray :: Ix i => (a -> Id c -> a) -> a -> Array i c -> a
General content types
Content identifiers for the content type c.
sentinelId :: Id cSource
Type family for auxiliary data structures for speeding up content operations.
Content operations for the content of type a.
Constructors
| Ops | |
Fields
| |
Operations for all content types, gathered together.
Constructors
| COps | |
createOps :: forall a. Show a => ContentDef a -> Ops aSource
Create content operations for type a from definition of content
of type a.
stdRuleset :: Ops RuleKind -> RuleKindSource
The standard ruleset used for level operations.
Arrays of content identifiers
Arrays of content identifiers pointing to the content type c,
where the identifiers are represented as Word8
(and so content of type c can have at most 256 elements).
The arrays are indexed by type i, e.g., a dungeon tile position.
(//) :: Ix i => Array i c -> [(i, Id c)] -> Array i cSource
Construct a content identifiers array updated with the association list.
listArray :: Ix i => (i, i) -> [Id c] -> Array i cSource
Create a content identifiers array from a list of elements.
array :: Ix i => (i, i) -> [(i, Id c)] -> Array i cSource
Create a content identifiers array from an association list.
foldlArray :: Ix i => (a -> Id c -> a) -> a -> Array i c -> aSource
Fold left strictly over an array.