ask if a new goalie is a rookie

This commit is contained in:
Jonathan Lamothe 2020-02-13 14:57:29 -05:00
parent fe28e96145
commit ec10aa7998

View File

@ -37,6 +37,7 @@ createGoalieC :: CreateGoalieState -> Controller
createGoalieC cgs createGoalieC cgs
| null $ cgs^.cgsNumber = getGoalieNumC | null $ cgs^.cgsNumber = getGoalieNumC
| null $ cgs^.cgsName = getGoalieNameC | null $ cgs^.cgsName = getGoalieNameC
| null $ cgs^.cgsRookieFlag = getRookieFlagC
| otherwise = confirmCreateGoalieC | otherwise = confirmCreateGoalieC
getGoalieNumC :: Controller getGoalieNumC :: Controller
@ -45,6 +46,16 @@ getGoalieNumC = promptController goalieNumPrompt
getGoalieNameC :: Controller getGoalieNameC :: Controller
getGoalieNameC = promptController goalieNamePrompt getGoalieNameC = promptController goalieNamePrompt
getRookieFlagC :: Controller
getRookieFlagC = Controller
{ drawController = const $ do
C.drawString "Is this goalie a rookie? (Y/N)"
return C.CursorInvisible
, handleController = \e -> do
modify $ progMode.createGoalieStateL.cgsRookieFlag .~ ynHandler e
return True
}
confirmCreateGoalieC :: Controller confirmCreateGoalieC :: Controller
confirmCreateGoalieC = Controller confirmCreateGoalieC = Controller
{ drawController = \s -> do { drawController = \s -> do