app

Safe Haskell None
Language Haskell2010

Model

Synopsis

Documentation

data Box #

Things that can be hovered or selected.

Constructors

BoxHand HandIndex  
BoxTarget Target

Player part/card

Instances
Eq Box #  
Instance details

Defined in Model

Methods

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

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

Ord Box #  
Instance details

Defined in Model

Methods

compare :: Box -> Box -> Ordering #

(<) :: Box -> Box -> Bool #

(<=) :: Box -> Box -> Bool #

(>) :: Box -> Box -> Bool #

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

max :: Box -> Box -> Box #

min :: Box -> Box -> Box #

Show Box #  
Instance details

Defined in Model

Methods

showsPrec :: Int -> Box -> ShowS #

show :: Box -> String #

showList :: [Box] -> ShowS #

data Interaction #

An interaction happening in the game page. TODO smelc remove Interaction@ suffix of constructors and move to new file?

Constructors

HoverInteraction Box

Hovering over a card in hand/in place

HoverSelectionInteraction Box Box

Hovering over something while there is a selection. If there is only hovering, then HoverInteraction is used. If there is only a selection, then SelectionInteraction is used.

NoInteraction  
SelectionInteraction Box  
ShowErrorInteraction Text  
Instances
Eq Interaction #  
Instance details

Defined in Model

Show Interaction #  
Instance details

Defined in Model

Generic Interaction #  
Instance details

Defined in Model

Associated Types

type Rep Interaction :: Type -> Type #

type Rep Interaction #  
Instance details

Defined in Model

toHover :: Interaction -> Maybe Box #

The hovering interaction, if any

toSelection :: Interaction -> Maybe Box #

The selection interaction, if any

addHover :: Box -> Interaction -> Interaction #

addHover ik i adds the hover interaction ik to i

rmHover :: Interaction -> Interaction #

rmHover i removes the hover interaction from i

addSelection :: Box -> Interaction -> Interaction #

addSelection s i adds the selection interaction s to i

rmSelection :: Interaction -> Interaction #

rmSelection i removes the selection interaction from i

data Game #

The model of the gaming page. If you add a field, think about extending the Show instance below.

Constructors

Game  

Fields

Instances
Eq Game #  
Instance details

Defined in Model

Methods

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

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

Show Game #  
Instance details

Defined in Model

Methods

showsPrec :: Int -> Game -> ShowS #

show :: Game -> String #

showList :: [Game] -> ShowS #

Generic Game #  
Instance details

Defined in Model

Associated Types

type Rep Game :: Type -> Type #

Methods

from :: Game -> Rep Game x #

to :: Rep Game x -> Game #

Contains Game T #  
Instance details

Defined in Model

Methods

to :: Game -> T #

With Game (Kernel ()) #  
Instance details

Defined in Move

Methods

with :: Game -> Kernel () -> Game #

With Game (Kernel Player) #  
Instance details

Defined in Move

Methods

with :: Game -> Kernel Player -> Game #

Contains Game (Kernel ()) #  
Instance details

Defined in Move

Methods

to :: Game -> Kernel () #

Contains Game (Kernel Player) #  
Instance details

Defined in Move

Methods

to :: Game -> Kernel Player #

type Rep Game #  
Instance details

Defined in Model

mkInitialGame #

Arguments

:: Model  
-> Difficulty  
-> Kind  
-> Map Coord Encounter

Encounters done already

-> (Coord, Encounter)

The location of the current encounter and the encounter itself

-> Maybe Journey  
-> Teams (Team, [Card Core])

The teams

-> Game  

An instance of Game that is ready for starting a game

mkWorld :: Model -> Map Coord Encounter -> Bool -> Player (Maybe Team) -> (Nat, Nat) -> World #

A smart constructor for World

unsafeLootModel :: Welcome -> Model #

Function for debugging only. Used to make the game start directly on the LootView.

unsafeGameModel :: Welcome -> Model #

Function for debugging only. Used to make the game start directly on the GameView. Similar to a function in Update (but we don't want to grow Update if we can avoid).

isPlayerTurn :: Game -> Bool #

Whether it's the turn of the playing player, i.e. neither the AI turn | nor the turn of the other player if in multiplayer.

data Player a #

Data of the playing player

Constructors

Player  

Fields

  • past :: Map Coord Encounter

    Encounters done already

  • pDeck :: [ID]

    The deck

  • position :: Coord

    The absolute position of the character, in number of cells

  • pSpot :: Player

    Where the player plays

  • pTeam :: a

    The player's team. Either instantiated by Maybe Team before the team has been picked in World. Then instantiated by Team.

Instances
Functor Player #  
Instance details

Defined in Model

Methods

fmap :: (a -> b) -> Player a -> Player b #

(<$) :: a -> Player b -> Player a #

Eq a => Eq (Player a) #  
Instance details

Defined in Model

Methods

(==) :: Player a -> Player a -> Bool #

(/=) :: Player a -> Player a -> Bool #

Show a => Show (Player a) #  
Instance details

Defined in Model

Methods

showsPrec :: Int -> Player a -> ShowS #

show :: Player a -> String #

showList :: [Player a] -> ShowS #

Generic (Player a) #  
Instance details

Defined in Model

Associated Types

type Rep (Player a) :: Type -> Type #

Methods

from :: Player a -> Rep (Player a) x #

to :: Rep (Player a) x -> Player a #

With (Player a) Coord #  
Instance details

Defined in Model

Methods

with :: Player a -> Coord -> Player a #

type Rep (Player a) #  
Instance details

Defined in Model

data World #

The model of the world page. If you add a field, consider extending the Show and Eq instances below.

Constructors

Network a => World  

Fields

Instances
Eq World #  
Instance details

Defined in Model

Methods

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

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

Show World #  
Instance details

Defined in Model

Methods

showsPrec :: Int -> World -> ShowS #

show :: World -> String #

showList :: [World] -> ShowS #

With World Coord #  
Instance details

Defined in Model

Methods

with :: World -> Coord -> World #

data PlayingMode #

Instances
Eq PlayingMode #  
Instance details

Defined in Model

Show PlayingMode #  
Instance details

Defined in Model

Generic PlayingMode #  
Instance details

Defined in Model

Associated Types

type Rep PlayingMode :: Type -> Type #

type Rep PlayingMode #  
Instance details

Defined in Model

type Rep PlayingMode = D1 (MetaData "PlayingMode" "Model" "main" False) ((C1 (MetaCons "NoPlayingMode" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "MultiPlayer" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "SinglePlayer" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "SinglePlayerTeam" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Team))))

data SceneModel #

Instances
Eq SceneModel #  
Instance details

Defined in Model

Show SceneModel #  
Instance details

Defined in Model

Generic SceneModel #  
Instance details

Defined in Model

Associated Types

type Rep SceneModel :: Type -> Type #

type Rep SceneModel #  
Instance details

Defined in Model

data Welcome #

The model of the welcome page

Constructors

Welcome  

Fields

Instances
Eq Welcome #  
Instance details

Defined in Model

Methods

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

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

Show Welcome #  
Instance details

Defined in Model

Methods

showsPrec :: Int -> Welcome -> ShowS #

show :: Welcome -> String #

showList :: [Welcome] -> ShowS #

Generic Welcome #  
Instance details

Defined in Model

Associated Types

type Rep Welcome :: Type -> Type #

Methods

from :: Welcome -> Rep Welcome x #

to :: Rep Welcome x -> Welcome #

type Rep Welcome #  
Instance details

Defined in Model

data SinglePlayerLobbyModel #

Constructors

SinglePlayerLobbyModel  

Fields

Instances
Eq SinglePlayerLobbyModel #  
Instance details

Defined in Model

Show SinglePlayerLobbyModel #  
Instance details

Defined in Model

Generic SinglePlayerLobbyModel #  
Instance details

Defined in Model

Associated Types

type Rep SinglePlayerLobbyModel :: Type -> Type #

type Rep SinglePlayerLobbyModel #  
Instance details

Defined in Model

type Rep SinglePlayerLobbyModel = D1 (MetaData "SinglePlayerLobbyModel" "Model" "main" False) (C1 (MetaCons "SinglePlayerLobbyModel" PrefixI True) (S1 (MetaSel (Just "singlePlayerLobbyTeam") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Team)) :*: S1 (MetaSel (Just "singlePlayerLobbyShared") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Model)))

data MultiPlayerLobbyModel #

Instances
Eq MultiPlayerLobbyModel #  
Instance details

Defined in Model

Show MultiPlayerLobbyModel #  
Instance details

Defined in Model

Generic MultiPlayerLobbyModel #  
Instance details

Defined in Model

Associated Types

type Rep MultiPlayerLobbyModel :: Type -> Type #

type Rep MultiPlayerLobbyModel #  
Instance details

Defined in Model

type Rep MultiPlayerLobbyModel = D1 (MetaData "MultiPlayerLobbyModel" "Model" "main" False) ((C1 (MetaCons "CollectingUserName" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UserName)) :+: (C1 (MetaCons "WaitingForNameSubmission" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UserName)) :+: C1 (MetaCons "DisplayingUserList" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe MultiPlayerLobbyError)) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UserName) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [UserName]))))) :+: (C1 (MetaCons "InvitingUser" PrefixI False) ((S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UserName) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [UserName])) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UserName) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 InvitationActorState))) :+: (C1 (MetaCons "Invited" PrefixI False) ((S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UserName) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [UserName])) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UserName) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 InvitedActorState))) :+: C1 (MetaCons "GameStarted" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UserName) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UserName)))))

data InvitationActorState #

Instances
Eq InvitationActorState #  
Instance details

Defined in Model

Show InvitationActorState #  
Instance details

Defined in Model

Generic InvitationActorState #  
Instance details

Defined in Model

Associated Types

type Rep InvitationActorState :: Type -> Type #

type Rep InvitationActorState #  
Instance details

Defined in Model

type Rep InvitationActorState = D1 (MetaData "InvitationActorState" "Model" "main" False) (C1 (MetaCons "WaitingForUserInvitationAck" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "WaitingForRSVP" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "WaitingForInvitationDropAck" PrefixI False) (U1 :: Type -> Type)))

data InvitedActorState #

Instances
Eq InvitedActorState #  
Instance details

Defined in Model

Show InvitedActorState #  
Instance details

Defined in Model

Generic InvitedActorState #  
Instance details

Defined in Model

Associated Types

type Rep InvitedActorState :: Type -> Type #

type Rep InvitedActorState #  
Instance details

Defined in Model

type Rep InvitedActorState = D1 (MetaData "InvitedActorState" "Model" "main" False) (C1 (MetaCons "CollectingUserRSVP" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "WaitingForRejectionAck" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "WaitingForAcceptanceAck" PrefixI False) (U1 :: Type -> Type)))

data Deck #

Constructors

Deck  

Fields

Instances
Eq Deck #  
Instance details

Defined in Model

Methods

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

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

Show Deck #  
Instance details

Defined in Model

Methods

showsPrec :: Int -> Deck -> ShowS #

show :: Deck -> String #

showList :: [Deck] -> ShowS #

Generic Deck #  
Instance details

Defined in Model

Associated Types

type Rep Deck :: Type -> Type #

Methods

from :: Deck -> Rep Deck x #

to :: Rep Deck x -> Deck #

Contains Deck T #  
Instance details

Defined in Model

Methods

to :: Deck -> T #

type Rep Deck #  
Instance details

Defined in Model

data Picked #

Whether a card has been picked or not in the LootView

Constructors

Picked

Reward has been chosen

NotPicked

Reward has not been chosen

Instances
Eq Picked #  
Instance details

Defined in Model

Methods

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

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

Ord Picked #  
Instance details

Defined in Model

Methods

compare :: Picked -> Picked -> Ordering #

(<) :: Picked -> Picked -> Bool #

(<=) :: Picked -> Picked -> Bool #

(>) :: Picked -> Picked -> Bool #

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

max :: Picked -> Picked -> Picked #

min :: Picked -> Picked -> Picked #

Show Picked #  
Instance details

Defined in Model

Methods

showsPrec :: Int -> Picked -> ShowS #

show :: Picked -> String #

showList :: [Picked] -> ShowS #

Generic Picked #  
Instance details

Defined in Model

Associated Types

type Rep Picked :: Type -> Type #

Methods

from :: Picked -> Rep Picked x #

to :: Rep Picked x -> Picked #

type Rep Picked #  
Instance details

Defined in Model

type Rep Picked = D1 (MetaData "Picked" "Model" "main" False) (C1 (MetaCons "Picked" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "NotPicked" PrefixI False) (U1 :: Type -> Type))

data Loot #

Constructors

Loot  

Fields

Instances
Eq Loot #  
Instance details

Defined in Model

Methods

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

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

Show Loot #  
Instance details

Defined in Model

Methods

showsPrec :: Int -> Loot -> ShowS #

show :: Loot -> String #

showList :: [Loot] -> ShowS #

Generic Loot #  
Instance details

Defined in Model

Associated Types

type Rep Loot :: Type -> Type #

Methods

from :: Loot -> Rep Loot x #

to :: Rep Loot x -> Loot #

type Rep Loot #  
Instance details

Defined in Model

data End #

Model when the game ends

Constructors

End  

Fields

  • win :: Bool

    Whether it's a win (True) or a loss (False)

Instances
Eq End #  
Instance details

Defined in Model

Methods

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

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

Show End #  
Instance details

Defined in Model

Methods

showsPrec :: Int -> End -> ShowS #

show :: End -> String #

showList :: [End] -> ShowS #

Generic End #  
Instance details

Defined in Model

Associated Types

type Rep End :: Type -> Type #

Methods

from :: End -> Rep End x #

to :: Rep End x -> End #

type Rep End #  
Instance details

Defined in Model

data Model #

The top level model. TODO @smelc introduce a View typeclass and use "Model = forall a. View a => Model a"? But I would lose pattern matching, hum?

Constructors

Deck' Deck  
End' End  
Game' Game  
Loot' Loot  
World' World  
Instances
Eq Model #  
Instance details

Defined in Model

Methods

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

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

Show Model #  
Instance details

Defined in Model

Methods

showsPrec :: Int -> Model -> ShowS #

show :: Model -> String #

showList :: [Model] -> ShowS #

Generic Model #  
Instance details

Defined in Model

Associated Types

type Rep Model :: Type -> Type #

Methods

from :: Model -> Rep Model x #

to :: Rep Model x -> Model #

type Rep Model #  
Instance details

Defined in Model