Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Box
- data Interaction
- toHover :: Interaction -> Maybe Box
- toSelection :: Interaction -> Maybe Box
- addHover :: Box -> Interaction -> Interaction
- rmHover :: Interaction -> Interaction
- addSelection :: Box -> Interaction -> Interaction
- rmSelection :: Interaction -> Interaction
- data Game = Game {}
- mkInitialGame :: Model -> Difficulty -> Kind -> Map Coord Encounter -> (Coord, Encounter) -> Maybe Journey -> Teams (Team, [Card Core]) -> Game
- mkWorld :: Model -> Map Coord Encounter -> Bool -> Player (Maybe Team) -> (Nat, Nat) -> World
- mkTopLeft :: Coord -> Coord
- gameToDeck :: Game -> [ID]
- gameToLoot :: Game -> Outcome -> Either End Loot
- unsafeLootModel :: Welcome -> Model
- unsafeGameModel :: Welcome -> Model
- isPlayerTurn :: Game -> Bool
- data Player a = Player {}
- data World = Network a => World {}
- data PlayingMode
- type TimedFrames = Vector TimedFrame
- data SceneModel
-
data Welcome = Welcome {
- sceneModel :: SceneModel
- shared :: Model
- keysDown :: Set Int
- data SinglePlayerLobbyModel = SinglePlayerLobbyModel {}
- data MultiPlayerLobbyError
- data MultiPlayerLobbyModel
- data InvitationActorState
- data InvitedActorState
- data Deck = Deck {}
- data Picked
- data Loot = Loot {}
- data End = End {}
- data Model
Documentation
data Interaction #
An interaction happening in the game page. TODO smelc remove
Interaction@ suffix of constructors and move to new file?
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 |
NoInteraction | |
SelectionInteraction Box | |
ShowErrorInteraction Text |
Instances
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
The model of the gaming page. If you add a field, think about
extending the Show
instance below.
Game | |
|
Instances
:: 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
gameToDeck :: Game -> [ID] #
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 of the playing player
Player | |
|
Instances
Functor Player # | |
Eq a => Eq (Player a) # | |
Show a => Show (Player a) # | |
Generic (Player a) # | |
With (Player a) Coord # | |
type Rep (Player a) # | |
Defined in Model
type Rep (Player a) = D1 (MetaData "Player" "Model" "main" False) (C1 (MetaCons "Player" PrefixI True) ((S1 (MetaSel (Just "past") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map Coord Encounter)) :*: S1 (MetaSel (Just "pDeck") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [ID])) :*: (S1 (MetaSel (Just "position") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Coord) :*: (S1 (MetaSel (Just "pSpot") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Player) :*: S1 (MetaSel (Just "pTeam") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a))))) |
The model of the world page. If you add a field, consider extending the Show and Eq instances below.
Network a => World | |
|
data PlayingMode #
Instances
Eq PlayingMode # | |
Defined in Model (==) :: PlayingMode -> PlayingMode -> Bool # (/=) :: PlayingMode -> PlayingMode -> Bool # | |
Show PlayingMode # | |
Defined in Model showsPrec :: Int -> PlayingMode -> ShowS # show :: PlayingMode -> String # showList :: [PlayingMode] -> ShowS # | |
Generic PlayingMode # | |
Defined in Model type Rep PlayingMode :: Type -> Type # from :: PlayingMode -> Rep PlayingMode x # to :: Rep PlayingMode x -> PlayingMode # | |
type Rep PlayingMode # | |
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)))) |
type TimedFrames = Vector TimedFrame #
data SceneModel #
SceneNotStarted TimedFrames | |
ScenePlaying TimedFrames Int | |
ScenePausedForDebugging TimedFrames Int | |
SceneComplete TimedFrames |
Instances
The model of the welcome page
Welcome | |
|
Instances
Eq Welcome # | |
Show Welcome # | |
Generic Welcome # | |
type Rep Welcome # | |
Defined in Model
type Rep Welcome = D1 (MetaData "Welcome" "Model" "main" False) (C1 (MetaCons "Welcome" PrefixI True) (S1 (MetaSel (Just "sceneModel") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 SceneModel) :*: (S1 (MetaSel (Just "shared") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Model) :*: S1 (MetaSel (Just "keysDown") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Set Int))))) |
data SinglePlayerLobbyModel #
SinglePlayerLobbyModel | |
|
Instances
Eq SinglePlayerLobbyModel # | |
Defined in Model (==) :: SinglePlayerLobbyModel -> SinglePlayerLobbyModel -> Bool # (/=) :: SinglePlayerLobbyModel -> SinglePlayerLobbyModel -> Bool # | |
Show SinglePlayerLobbyModel # | |
Defined in Model showsPrec :: Int -> SinglePlayerLobbyModel -> ShowS # show :: SinglePlayerLobbyModel -> String # showList :: [SinglePlayerLobbyModel] -> ShowS # | |
Generic SinglePlayerLobbyModel # | |
type Rep SinglePlayerLobbyModel # | |
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 MultiPlayerLobbyError #
Instances
data MultiPlayerLobbyModel #
Instances
data InvitationActorState #
Instances
Eq InvitationActorState # | |
Defined in Model (==) :: InvitationActorState -> InvitationActorState -> Bool # (/=) :: InvitationActorState -> InvitationActorState -> Bool # | |
Show InvitationActorState # | |
Defined in Model showsPrec :: Int -> InvitationActorState -> ShowS # show :: InvitationActorState -> String # showList :: [InvitationActorState] -> ShowS # | |
Generic InvitationActorState # | |
Defined in Model type Rep InvitationActorState :: Type -> Type # from :: InvitationActorState -> Rep InvitationActorState x # to :: Rep InvitationActorState x -> InvitationActorState # | |
type Rep InvitationActorState # | |
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 # | |
Defined in Model (==) :: InvitedActorState -> InvitedActorState -> Bool # (/=) :: InvitedActorState -> InvitedActorState -> Bool # | |
Show InvitedActorState # | |
Defined in Model showsPrec :: Int -> InvitedActorState -> ShowS # show :: InvitedActorState -> String # showList :: [InvitedActorState] -> ShowS # | |
Generic InvitedActorState # | |
Defined in Model type Rep InvitedActorState :: Type -> Type # from :: InvitedActorState -> Rep InvitedActorState x # to :: Rep InvitedActorState x -> InvitedActorState # | |
type Rep InvitedActorState # | |
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))) |
Instances
Eq Deck # | |
Show Deck # | |
Generic Deck # | |
Contains Deck T # | |
type Rep Deck # | |
Defined in Model
type Rep Deck = D1 (MetaData "Deck" "Model" "main" False) (C1 (MetaCons "Deck" PrefixI True) ((S1 (MetaSel (Just "deck") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Card Core]) :*: (S1 (MetaSel (Just "deckBack") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Model) :*: S1 (MetaSel (Just "player") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Player))) :*: (S1 (MetaSel (Just "team") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Team) :*: (S1 (MetaSel (Just "turn") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 T) :*: S1 (MetaSel (Just "shared") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Model))))) |
Whether a card has been picked or not in the LootView
Instances
Eq Loot # | |
Show Loot # | |
Generic Loot # | |
type Rep Loot # | |
Defined in Model
type Rep Loot = D1 (MetaData "Loot" "Model" "main" False) (C1 (MetaCons "Loot" PrefixI True) ((S1 (MetaSel (Just "fade") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Fade) :*: S1 (MetaSel (Just "nbRewards") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Nat)) :*: (S1 (MetaSel (Just "player") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Player Team)) :*: (S1 (MetaSel (Just "shared") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Model) :*: S1 (MetaSel (Just "rewards") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(ID, Picked)]))))) |
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?
Instances
Eq Model # | |
Show Model # | |
Generic Model # | |
type Rep Model # | |
Defined in Model
type Rep Model = D1 (MetaData "Model" "Model" "main" False) ((C1 (MetaCons "Deck'" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Deck)) :+: C1 (MetaCons "End'" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 End))) :+: (C1 (MetaCons "Game'" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Game)) :+: (C1 (MetaCons "Loot'" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Loot)) :+: C1 (MetaCons "World'" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 World))))) |