{-# LANGUAGE DeriveGeneric #-}
module Game.LambdaHack.Common.Kind
( ContentId, ContentData, COps(..)
, emptyCOps, getStdRuleset
, okind, ouniqGroup, opick
, ofoldrWithKey, ofoldlWithKey', ofoldlGroup', omapVector, oimapVector
, olength
) where
import Prelude ()
import Game.LambdaHack.Common.Prelude
import GHC.Generics (Generic)
import Game.LambdaHack.Common.ContentData
import Game.LambdaHack.Content.CaveKind
import Game.LambdaHack.Content.ItemKind
import Game.LambdaHack.Content.ModeKind
import Game.LambdaHack.Content.PlaceKind
import Game.LambdaHack.Content.RuleKind
import Game.LambdaHack.Content.TileKind
data COps = COps
{ cocave :: ContentData CaveKind
, coitem :: ContentData ItemKind
, comode :: ContentData ModeKind
, coplace :: ContentData PlaceKind
, corule :: ContentData RuleKind
, cotile :: ContentData TileKind
, coItemSpeedup :: ItemSpeedup
, coTileSpeedup :: TileSpeedup
}
deriving Generic
instance Show COps where
show _ = "game content"
instance Eq COps where
(==) _ _ = True
emptyCOps :: COps
emptyCOps = COps
{ cocave = emptyContentData
, coitem = emptyContentData
, comode = emptyContentData
, coplace = emptyContentData
, corule = emptyContentData
, cotile = emptyContentData
, coItemSpeedup = emptyItemSpeedup
, coTileSpeedup = emptyTileSpeedup
}
getStdRuleset :: COps -> RuleKind
getStdRuleset COps{corule} = okind corule $ ouniqGroup corule "standard"