prompt user for players who've scored goals
This commit is contained in:
parent
e80b7ec48c
commit
a66be1a45e
|
@ -53,6 +53,7 @@ dispatch s = case s^.progMode of
|
|||
| null $ gs^.awayScore -> awayScoreC
|
||||
| null $ gs^.overtimeFlag -> overtimeFlagC
|
||||
| not $ gs^.dataVerified -> verifyDataC
|
||||
| fromJust (unaccountedPoints gs) -> recordGoalC
|
||||
| otherwise -> reportC
|
||||
CreatePlayer cps
|
||||
| null $ cps^.cpsNumber -> getPlayerNumC
|
||||
|
@ -181,6 +182,19 @@ verifyDataC = Controller
|
|||
return True
|
||||
}
|
||||
|
||||
recordGoalC :: Controller
|
||||
recordGoalC = Controller
|
||||
{ drawController = \s -> let
|
||||
game = s^.database.dbGames
|
||||
goal = succ $ s^.progMode.gameStateL.pointsAccounted
|
||||
in drawPrompt (recordGoalPrompt game goal) s
|
||||
, handleController = \e -> do
|
||||
game <- gets $ view $ database.dbGames
|
||||
goal <- succ <$> gets (view $ progMode.gameStateL.pointsAccounted)
|
||||
promptHandler (recordGoalPrompt game goal) e
|
||||
return True
|
||||
}
|
||||
|
||||
reportC :: Controller
|
||||
reportC = Controller
|
||||
{ drawController = \s -> do
|
||||
|
|
Loading…
Reference in New Issue
Block a user