Safe Haskell | None |
---|
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
data Id c
Content identifiers for the content type c
.
sentinelId :: Id c
data family Speedup a
Type family for auxiliary data structures for speeding up content operations.
data Ops a
Content operations for the content of type a
.
Ops | |
|
createOps :: forall a. Show a => ContentDef a -> Ops a
Create content operations for type a
from definition of content
of type a
.
stdRuleset :: Ops RuleKind -> RuleKind
The standard ruleset used for level operations.
Arrays of content identifiers
data Array i c
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 c
Construct a content identifiers array updated with the association list.
listArray :: Ix i => (i, i) -> [Id c] -> Array i c
Create a content identifiers array from a list of elements.
array :: Ix i => (i, i) -> [(i, Id c)] -> Array i c
Create a content identifiers array from an association list.
foldlArray :: Ix i => (a -> Id c -> a) -> a -> Array i c -> a
Fold left strictly over an array.