From 101f436424a063c25f375b0c2eda0160643887e3 Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Thu, 14 Nov 2019 02:02:06 -0500 Subject: [PATCH] implemented editGoalieYtdTiesPrompt --- 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 1417f4d..4615411 100644 --- a/src/Mtlstats/Actions/EditGoalie.hs +++ b/src/Mtlstats/Actions/EditGoalie.hs @@ -27,6 +27,7 @@ module Mtlstats.Actions.EditGoalie , editGoalieYtdGoals , editGoalieYtdWins , editGoalieYtdLosses + , editGoalieYtdTies ) where import Control.Monad (void) @@ -92,6 +93,14 @@ editGoalieYtdLosses -> ProgState editGoalieYtdLosses losses = editGoalie (gYtd.gsLosses .~ losses) EGYtd +-- | Edits a goalie's YTD ties +editGoalieYtdTies + :: Int + -- ^ The number of ties + -> ProgState + -> ProgState +editGoalieYtdTies = 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 c0158a8..d3e6ea4 100644 --- a/src/Mtlstats/Prompt/EditGoalie.hs +++ b/src/Mtlstats/Prompt/EditGoalie.hs @@ -80,4 +80,5 @@ editGoalieYtdLossesPrompt = numPrompt "Year-to-date losses: " $ -- | Prompt to edit a goalie's YTD ties editGoalieYtdTiesPrompt :: Prompt -editGoalieYtdTiesPrompt = undefined +editGoalieYtdTiesPrompt = numPrompt "Year-to-date ties: " $ + modify . editGoalieYtdTies