| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Game.LambdaHack.Common.Kind
Description
General content types and operations.
Synopsis
- data ContentId c
- data ContentData c
- data COps = COps {}
- emptyCOps :: COps
- getStdRuleset :: COps -> RuleKind
- okind :: ContentData a -> ContentId a -> a
- ouniqGroup :: Show a => ContentData a -> GroupName a -> ContentId a
- opick :: Show a => ContentData a -> GroupName a -> (a -> Bool) -> Rnd (Maybe (ContentId a))
- ofoldrWithKey :: ContentData a -> (ContentId a -> a -> b -> b) -> b -> b
- ofoldlWithKey' :: ContentData a -> (b -> ContentId a -> a -> b) -> b -> b
- ofoldlGroup' :: ContentData a -> GroupName a -> (b -> Int -> ContentId a -> a -> b) -> b -> b
- omapVector :: ContentData a -> (a -> b) -> Vector b
- oimapVector :: ContentData a -> (ContentId a -> a -> b) -> Vector b
- olength :: ContentData a -> Int
Documentation
Content identifiers for the content type c.
Instances
data ContentData c #
Verified and preprocessed content data of a particular kind.
Instances
| Generic (ContentData c) # | |
Defined in Game.LambdaHack.Common.ContentData Associated Types type Rep (ContentData c) :: Type -> Type # Methods from :: ContentData c -> Rep (ContentData c) x # to :: Rep (ContentData c) x -> ContentData c # | |
| NFData c => NFData (ContentData c) # | |
Defined in Game.LambdaHack.Common.ContentData Methods rnf :: ContentData c -> () # | |
| type Rep (ContentData c) # | |
Defined in Game.LambdaHack.Common.ContentData type Rep (ContentData c) = D1 (MetaData "ContentData" "Game.LambdaHack.Common.ContentData" "LambdaHack-0.8.3.0-1NVXOytHwux3AEZcvJHaGA" False) (C1 (MetaCons "ContentData" PrefixI True) (S1 (MetaSel (Just "contentVector") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 (Vector c)) :*: S1 (MetaSel (Just "groupFreq") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 (Map (GroupName c) [(Int, (ContentId c, c))])))) | |
Operations for all content types, gathered together.
Constructors
| COps | |
Fields | |
Instances
getStdRuleset :: COps -> RuleKind #
The standard ruleset used for level operations.
okind :: ContentData a -> ContentId a -> a #
Content element at given id.
ouniqGroup :: Show a => ContentData a -> GroupName a -> ContentId a #
The id of the unique member of a singleton content group.
opick :: Show a => ContentData a -> GroupName a -> (a -> Bool) -> Rnd (Maybe (ContentId a)) #
Pick a random id belonging to a group and satisfying a predicate.
ofoldrWithKey :: ContentData a -> (ContentId a -> a -> b -> b) -> b -> b #
Fold over all content elements of a.
ofoldlWithKey' :: ContentData a -> (b -> ContentId a -> a -> b) -> b -> b #
Fold strictly over all content a.
ofoldlGroup' :: ContentData a -> GroupName a -> (b -> Int -> ContentId a -> a -> b) -> b -> b #
Fold over the given group only.
omapVector :: ContentData a -> (a -> b) -> Vector b #
oimapVector :: ContentData a -> (ContentId a -> a -> b) -> Vector b #
olength :: ContentData a -> Int #
Size of content a.