implemented Mtlstats.Control.GoalieInput.selectGoalieC

This commit is contained in:
Jonathan Lamothe 2019-10-29 02:51:20 -04:00
parent 8ef1c6917a
commit 6c634cd366
2 changed files with 16 additions and 5 deletions

View File

@ -23,17 +23,23 @@ module Mtlstats.Control.GoalieInput (goalieInput) where
import Lens.Micro ((^.)) import Lens.Micro ((^.))
import Mtlstats.Prompt
import Mtlstats.Types import Mtlstats.Types
-- | The dispatcher for handling goalie input -- | The dispatcher for handling goalie input
goalieInput :: GameState -> Controller goalieInput :: GameState -> Controller
goalieInput gs goalieInput gs
| null $ gs^.gameSelectedGoalie = selectGoalieC | null $ gs^.gameSelectedGoalie = selectGoalieC
| null $ gs^.goalieMinsPlayed = minsPlayedC | null $ gs^.goalieMinsPlayed = minsPlayedC
| otherwise = goalsAllowedC | otherwise = goalsAllowedC
selectGoalieC :: Controller selectGoalieC :: Controller
selectGoalieC = undefined selectGoalieC = Controller
{ drawController = drawPrompt selectGameGoaliePrompt
, handleController = \e -> do
promptHandler selectGameGoaliePrompt e
return True
}
minsPlayedC :: Controller minsPlayedC :: Controller
minsPlayedC = undefined minsPlayedC = undefined

View File

@ -42,7 +42,8 @@ module Mtlstats.Prompt (
pMinPlayerPrompt, pMinPlayerPrompt,
assignPMinsPrompt, assignPMinsPrompt,
goalieNumPrompt, goalieNumPrompt,
goalieNamePrompt goalieNamePrompt,
selectGameGoaliePrompt
) where ) where
import Control.Monad (when) import Control.Monad (when)
@ -259,5 +260,9 @@ goalieNamePrompt :: Prompt
goalieNamePrompt = strPrompt "Goalie name: " $ goalieNamePrompt = strPrompt "Goalie name: " $
modify . (progMode.createGoalieStateL.cgsName .~) modify . (progMode.createGoalieStateL.cgsName .~)
-- | Prompts for a goalie who played in the game
selectGameGoaliePrompt :: Prompt
selectGameGoaliePrompt = 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