app

Safe Haskell None
Language Haskell2010

Update

Synopsis

Documentation

data LootAction #

Actions internal to LootView

Constructors

Pick Nat

Select a reward. The index is in the list of available rewards.

Unpick Nat

Unselect a reward. The index is in the list of available rewards.

Instances
Eq LootAction #  
Instance details

Defined in Update

Show LootAction #  
Instance details

Defined in Update

data WelcomeDestination #

To which page to go to, from the welcome page

data Action #

Sum type for application events. If drop stuff doesn't work | think whether it's affected by https://github.com/dmjio/miso/issues/478

Constructors

DeckBack

Leave DeckView, go to another view

DeckGo DeckViewInput

Leave a view, go to DeckView

EndGo End

Go to end view

GameAction' Move  
LootAction' LootAction

Actions internal to LootView

LootGo Loot

Go to LootView

LootFrom World

Leave LootView, go to WorldView

NoOp  
SayHelloWorld  
SceneAction' SceneAction  
Keyboard (Set Int)  
KeyboardArrows Arrows

Arrows have been pressed

WelcomeGo WelcomeDestination  
WorldToGame Team Kind (Coord, Encounter)

Leave WorldView, enter GameView. The first team is the team to fight. The theme is the one to use for this fight. The third argument is the location where the fight happens

Instances
Eq Action #  
Instance details

Defined in Update

Methods

(==) :: Action -> Action -> Bool #

(/=) :: Action -> Action -> Bool #

Show Action #  
Instance details

Defined in Update

Methods

showsPrec :: Int -> Action -> ShowS #

show :: Action -> String #

showList :: [Action] -> ShowS #

data SceneAction #

Instances
Eq SceneAction #  
Instance details

Defined in Update

Show SceneAction #  
Instance details

Defined in Update

logUpdates :: (Monad m, Eq a, ToExpr a) => (Action -> a -> m a) -> Action -> a -> m a #

nextSchedToMiso :: NextSched -> [(Int, Action)] #

Transforms a NextSched into a value suitable for being passed to delayActions.

updateGameModel #

Arguments

:: MonadError Text m  
=> Game

The existing model

-> Move

The incoming UI action

-> m (Game, NextSched)  

We MUST return Sched as the second element (as opposed to Event). This is used for GameIncrTurn for example. The second element must only contain delayed stuff, it's invalid to return a list whose first element has 0. If we did that, we would need to play this event right away, and then we would have new delayed actions to consider which we wouldn't know how to merge with the first ones. If you feel like adding a 0 event, you instead need to play this event right away by doing a recursive call (or use playOne)

updateLootModel :: LootAction -> Loot -> Loot #

Update a LootModel according to the input LootAction

delayActions :: m -> [(Int, Action)] -> Effect Action m #

Function courtesy of @dmjio! Input type should be Int. Nat might be too small (see tenthToSecs).

toSecs :: Int -> Int #

Seconds to scheduling delay

tenthToSecs :: Int -> Int #

Tenth of seconds to scheduling delay

updateModel :: Action -> Model -> Effect Action Model #

Updates model, optionally introduces side effects | This function delegates to the various specialized functions | and is the only one to handle page changes. A page change event | is one that takes a model from a page and returns a model of another page. | Such an event cannot be dealt with a specialized function | (SpecializedAction -> SpecializedModel -> SpecializedModel), | it needs to be in `Action -> Model -> Model`.

unsafeInitialGameModel #

Arguments

:: Difficulty  
-> Model  
-> Teams (Team, [Card Core])

The initial decks

-> T Core

The board

-> Game  

An initial model, with a custom board. ! Not for production !\