Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module contains the subset of the model that is needed by Game
I didn't want to make Game
depend on Model
, because it seemed overkill
and dangerous cyclewise in the long run. Hence I introduced this module.
|
Synopsis
- cardToFilepath :: Model -> Card UI -> Filepath
- create :: [Card UI] -> [Pack] -> [TileUI] -> StdGen -> Model
- creatureToFilepath :: Model -> Creature UI -> Maybe Filepath
- getInitialDeck :: Model -> Team -> [Card Core]
- idToCreature :: Model -> CreatureID -> [Item] -> Maybe (Creature UI)
- keyToCard :: Key a => Model -> a -> Maybe (Card UI)
- keyToCardCommon :: Key a => Model -> a -> Maybe (CardCommon UI)
- class Lift p where
- class Mlift p where
- data Model
- tileToFilepath :: Model -> Tile -> Size -> Filepath
- liftSkill :: Model -> Skill -> Pack
- getStdGen :: Model -> StdGen
- getCards :: Model -> [Card UI]
- withCmd :: Model -> Maybe String -> Model
- withStdGen :: Model -> StdGen -> Model
- getCardIdentifiers :: Model -> [ID]
- withSeed :: Model -> Int -> Model
- allCommands :: Model -> [Command]
- unsafeToCardCommon :: Show a => Key a => Model -> a -> CardCommon UI
- identToItem :: Model -> Item -> ItemObject UI
- identToNeutral :: Model -> Neutral -> NeutralObject UI
- unsafeGet :: Model
- unsafeKeyToCard :: Show a => Key a => Model -> a -> Card UI
Documentation
creatureToFilepath :: Model -> Creature UI -> Maybe Filepath #
Maps a creature to the filepath of its tile.
idToCreature :: Model -> CreatureID -> [Item] -> Maybe (Creature UI) #
keyToCardCommon :: Key a => Model -> a -> Maybe (CardCommon UI) #
Instances
Lift ItemObject # | |
Defined in Shared lift :: Model -> ItemObject Core -> ItemObject UI # | |
Lift NeutralObject # | |
Defined in Shared lift :: Model -> NeutralObject Core -> NeutralObject UI # |
The part of the model that is likely to be used by all pages
i.e. all possible models ! If you add a field, extend the EQ
instance below. !
Note that we MUST have an EQ
instance, because ultimately, our top-level
model should have one. It is required by miso in the startApp
function.
It makes sense, since miso does diffs on models.
Instances
Eq Model # | |
Show Model # | |
Generic Model # | |
RandomGen Model # | Instance to be able to use |
With (Kernel a) (Model, T Core, T UI) # | |
Contains (Kernel a) (Model, T Core, T UI) # | |
With (Kernel a) (Model, T Core, T UI, Animation) # | |
Contains (Kernel a) (Model, T Core, T UI, Animation) # | |
type Rep Model # | |
Defined in Shared
type Rep Model = D1 (MetaData "Model" "Shared" "main" False) (C1 (MetaCons "Model" PrefixI True) ((S1 (MetaSel (Just "cards") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map ID (Card UI))) :*: S1 (MetaSel (Just "cmd") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe String))) :*: (S1 (MetaSel (Just "skills") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map Skill Pack)) :*: (S1 (MetaSel (Just "tiles") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map Tile TileUI)) :*: S1 (MetaSel (Just "stdGen") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 StdGen))))) |
withStdGen :: Model -> StdGen -> Model #
getCardIdentifiers :: Model -> [ID] #
allCommands :: Model -> [Command] #
unsafeToCardCommon :: Show a => Key a => Model -> a -> CardCommon UI #
identToItem :: Model -> Item -> ItemObject UI #
identToNeutral :: Model -> Neutral -> NeutralObject UI #