prompt user for players who've scored goals

This commit is contained in:
Jonathan Lamothe 2019-09-19 06:12:02 -04:00
parent e80b7ec48c
commit a66be1a45e

View File

@ -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