implemented goalsAllowedC

This commit is contained in:
Jonathan Lamothe
2019-10-31 00:24:54 -04:00
parent 4fa707bc0f
commit cb0b4f9d0b
2 changed files with 14 additions and 2 deletions

View File

@@ -56,7 +56,14 @@ minsPlayedC = Controller
} }
goalsAllowedC :: Controller goalsAllowedC :: Controller
goalsAllowedC = undefined goalsAllowedC = Controller
{ drawController = \s -> do
C.drawString $ header s
drawPrompt goalsAllowedPrompt s
, handleController = \e -> do
promptHandler goalsAllowedPrompt e
return True
}
header :: ProgState -> String header :: ProgState -> String
header s = unlines header s = unlines

View File

@@ -46,7 +46,8 @@ module Mtlstats.Prompt (
goalieNumPrompt, goalieNumPrompt,
goalieNamePrompt, goalieNamePrompt,
selectGameGoaliePrompt, selectGameGoaliePrompt,
goalieMinsPlayedPrompt goalieMinsPlayedPrompt,
goalsAllowedPrompt
) where ) where
import Control.Monad (when) import Control.Monad (when)
@@ -316,5 +317,9 @@ goalieMinsPlayedPrompt :: Prompt
goalieMinsPlayedPrompt = numPrompt "Minutes played: " $ goalieMinsPlayedPrompt = numPrompt "Minutes played: " $
modify . (progMode.gameStateL.goalieMinsPlayed ?~) modify . (progMode.gameStateL.goalieMinsPlayed ?~)
-- | Prompts for the number of goals the goalie allowed
goalsAllowedPrompt :: Prompt
goalsAllowedPrompt = undefined
drawSimplePrompt :: String -> ProgState -> C.Update () drawSimplePrompt :: String -> ProgState -> C.Update ()
drawSimplePrompt pStr s = C.drawString $ pStr ++ s^.inputBuffer drawSimplePrompt pStr s = C.drawString $ pStr ++ s^.inputBuffer