From 3ba3875752586683293cf09f8010df796c23aae2 Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Thu, 14 Nov 2019 02:49:55 -0500 Subject: [PATCH] implemented editGoalieLtLossesPrompt --- 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 932df4d..bdab0c4 100644 --- a/src/Mtlstats/Actions/EditGoalie.hs +++ b/src/Mtlstats/Actions/EditGoalie.hs @@ -32,6 +32,7 @@ module Mtlstats.Actions.EditGoalie , editGoalieLtMins , editGoalieLtGoals , editGoalieLtWins + , editGoalieLtLosses ) where import Control.Monad (void) @@ -137,6 +138,14 @@ editGoalieLtWins -> ProgState editGoalieLtWins wins = editGoalie (gLifetime.gsWins .~ wins) EGLifetime +-- | Edits a goalie's lifetime losses +editGoalieLtLosses + :: Int + -- ^ The number of losses + -> ProgState + -> ProgState +editGoalieLtLosses = 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 44f8602..843e63e 100644 --- a/src/Mtlstats/Prompt/EditGoalie.hs +++ b/src/Mtlstats/Prompt/EditGoalie.hs @@ -110,4 +110,5 @@ editGoalieLtWinsPrompt = numPrompt "Lifetime wins: " $ -- | Prompt to edit a goalie's lifetime losses editGoalieLtLossesPrompt :: Prompt -editGoalieLtLossesPrompt = undefined +editGoalieLtLossesPrompt = numPrompt "Lifetime losses: " $ + modify . editGoalieLtLosses