From 0202ddadabc742e06e8d9e8741b4a2261d77c7c3 Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Tue, 12 Nov 2019 23:58:17 -0500 Subject: [PATCH] implemented editGoalieNumberPrompt --- src/Mtlstats/Actions/EditGoalie.hs | 34 ++++++++++++++++++++++++++++++ src/Mtlstats/Prompt/EditGoalie.hs | 4 +++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 src/Mtlstats/Actions/EditGoalie.hs diff --git a/src/Mtlstats/Actions/EditGoalie.hs b/src/Mtlstats/Actions/EditGoalie.hs new file mode 100644 index 0000000..ebc46a1 --- /dev/null +++ b/src/Mtlstats/Actions/EditGoalie.hs @@ -0,0 +1,34 @@ +{- | + +mtlstats +Copyright (C) 2019 Rhéal Lamothe + + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or (at +your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +-} + +module Mtlstats.Actions.EditGoalie + ( setGoalieNumber + ) where + +import Mtlstats.Types + +-- | Sets a goalie's number +setGoalieNumber + :: Int + -- ^ New goalie number + -> ProgState + -> ProgState +setGoalieNumber = undefined diff --git a/src/Mtlstats/Prompt/EditGoalie.hs b/src/Mtlstats/Prompt/EditGoalie.hs index b70e4b6..4ac60f1 100644 --- a/src/Mtlstats/Prompt/EditGoalie.hs +++ b/src/Mtlstats/Prompt/EditGoalie.hs @@ -27,6 +27,7 @@ module Mtlstats.Prompt.EditGoalie import Control.Monad.Trans.State (modify) import Lens.Micro ((.~)) +import Mtlstats.Actions.EditGoalie import Mtlstats.Prompt import Mtlstats.Types @@ -37,4 +38,5 @@ goalieToEditPrompt = selectGoaliePrompt "Goalie to edit: " $ -- | Prompt to edit a goalie's number editGoalieNumberPrompt :: Prompt -editGoalieNumberPrompt = undefined +editGoalieNumberPrompt = numPrompt "Goalie number: " $ + modify . setGoalieNumber