From 6b1aa85010b4148c51644f861fc3c812bfb2cf47 Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Thu, 14 Nov 2019 02:11:35 -0500 Subject: [PATCH] implemented editGoalieLtGamesPrompt --- 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 cb0f129..b22002a 100644 --- a/src/Mtlstats/Actions/EditGoalie.hs +++ b/src/Mtlstats/Actions/EditGoalie.hs @@ -28,6 +28,7 @@ module Mtlstats.Actions.EditGoalie , editGoalieYtdWins , editGoalieYtdLosses , editGoalieYtdTies + , editGoalieLtGames ) where import Control.Monad (void) @@ -101,6 +102,14 @@ editGoalieYtdTies -> ProgState editGoalieYtdTies ties = editGoalie (gYtd.gsTies .~ ties) EGYtd +-- | Edits a goalie's lifetime games played +editGoalieLtGames + :: Int + -- ^ The number of games + -> ProgState + -> ProgState +editGoalieLtGames = 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 21788f4..e3b82c0 100644 --- a/src/Mtlstats/Prompt/EditGoalie.hs +++ b/src/Mtlstats/Prompt/EditGoalie.hs @@ -86,4 +86,5 @@ editGoalieYtdTiesPrompt = numPrompt "Year-to-date ties: " $ -- | Prompt to edit a goalie's lifetime games played editGoalieLtGamesPrompt :: Prompt -editGoalieLtGamesPrompt = undefined +editGoalieLtGamesPrompt = numPrompt "Lifetime games played: " $ + modify . editGoalieLtGames