From f739db4203f1cfd5f98c62fa8c7b4f2e6279e32b Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Thu, 14 Nov 2019 00:48:41 -0500 Subject: [PATCH] implemented editGoalieYtdGamesPrompt --- src/Mtlstats/Actions/EditGoalie.hs | 9 +++++++++ src/Mtlstats/Prompt/EditGoalie.hs | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Mtlstats/Actions/EditGoalie.hs b/src/Mtlstats/Actions/EditGoalie.hs index 30e8213..8e5e9bb 100644 --- a/src/Mtlstats/Actions/EditGoalie.hs +++ b/src/Mtlstats/Actions/EditGoalie.hs @@ -22,6 +22,7 @@ along with this program. If not, see . module Mtlstats.Actions.EditGoalie ( editGoalieNumber , editGoalieName + , editGoalieYtdGames ) where import Control.Monad (void) @@ -47,6 +48,14 @@ editGoalieName -> ProgState editGoalieName name = editGoalie (gName .~ name) EGMenu +-- | Edits a goalie's YTD games +editGoalieYtdGames + :: Int + -- ^ The number of games played + -> ProgState + -> ProgState +editGoalieYtdGames = undefined + editGoalie :: (Goalie -> Goalie) -> EditGoalieMode -> ProgState -> ProgState editGoalie f mode s = fromMaybe s $ do gid <- s^.progMode.editGoalieStateL.egsSelectedGoalie diff --git a/src/Mtlstats/Prompt/EditGoalie.hs b/src/Mtlstats/Prompt/EditGoalie.hs index 2f9224d..aac4311 100644 --- a/src/Mtlstats/Prompt/EditGoalie.hs +++ b/src/Mtlstats/Prompt/EditGoalie.hs @@ -50,4 +50,5 @@ editGoalieNamePrompt = strPrompt "Goalie name: " $ -- | Prompt to edit a goalie's YTD games played editGoalieYtdGamesPrompt :: Prompt -editGoalieYtdGamesPrompt = undefined +editGoalieYtdGamesPrompt = numPrompt "Year-to-date games played: " $ + modify . editGoalieYtdGames