allow ProgMode to handle goalie creation

This commit is contained in:
Jonathan Lamothe 2019-10-22 00:21:51 -04:00
parent 1782c0bc48
commit 2a94e99371
2 changed files with 15 additions and 0 deletions

View File

@ -64,6 +64,10 @@ dispatch s = case s^.progMode of
| null $ cps^.cpsName -> getPlayerNameC | null $ cps^.cpsName -> getPlayerNameC
| null $ cps^.cpsPosition -> getPlayerPosC | null $ cps^.cpsPosition -> getPlayerPosC
| otherwise -> confirmCreatePlayerC | otherwise -> confirmCreatePlayerC
CreateGoalie cgs
| null $ cgs^.cgsNumber -> getGoalieNumC
| null $ cgs^.cgsName -> getGoalieNameC
| otherwise -> confirmCreateGoalieC
mainMenuC :: Controller mainMenuC :: Controller
mainMenuC = Controller mainMenuC = Controller
@ -336,6 +340,15 @@ confirmCreatePlayerC = Controller
return True return True
} }
getGoalieNumC :: Controller
getGoalieNumC = undefined
getGoalieNameC :: Controller
getGoalieNameC = undefined
confirmCreateGoalieC :: Controller
confirmCreateGoalieC = undefined
gameGoal :: ProgState -> (Int, Int) gameGoal :: ProgState -> (Int, Int)
gameGoal s = gameGoal s =
( s^.database.dbGames ( s^.database.dbGames

View File

@ -196,12 +196,14 @@ data ProgMode
| NewSeason | NewSeason
| NewGame GameState | NewGame GameState
| CreatePlayer CreatePlayerState | CreatePlayer CreatePlayerState
| CreateGoalie CreateGoalieState
instance Show ProgMode where instance Show ProgMode where
show MainMenu = "MainMenu" show MainMenu = "MainMenu"
show NewSeason = "NewSeason" show NewSeason = "NewSeason"
show (NewGame _) = "NewGame" show (NewGame _) = "NewGame"
show (CreatePlayer _) = "CreatePlayer" show (CreatePlayer _) = "CreatePlayer"
show (CreateGoalie _) = "CreateGoalie"
-- | The game state -- | The game state
data GameState = GameState data GameState = GameState