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^.cpsPosition -> getPlayerPosC
| otherwise -> confirmCreatePlayerC
CreateGoalie cgs
| null $ cgs^.cgsNumber -> getGoalieNumC
| null $ cgs^.cgsName -> getGoalieNameC
| otherwise -> confirmCreateGoalieC
mainMenuC :: Controller
mainMenuC = Controller
@ -336,6 +340,15 @@ confirmCreatePlayerC = Controller
return True
}
getGoalieNumC :: Controller
getGoalieNumC = undefined
getGoalieNameC :: Controller
getGoalieNameC = undefined
confirmCreateGoalieC :: Controller
confirmCreateGoalieC = undefined
gameGoal :: ProgState -> (Int, Int)
gameGoal s =
( s^.database.dbGames

View File

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