From 3d1f6170f69a362384ce812c075e6bcadf08cd22 Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Wed, 9 Oct 2019 22:32:14 -0400 Subject: [PATCH] implemented assignPMinsPrompt --- src/Mtlstats/Actions.hs | 9 +++++++++ src/Mtlstats/Prompt.hs | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Mtlstats/Actions.hs b/src/Mtlstats/Actions.hs index 5d14e80..b1dbde2 100644 --- a/src/Mtlstats/Actions.hs +++ b/src/Mtlstats/Actions.hs @@ -36,6 +36,7 @@ module Mtlstats.Actions , awardGoal , awardAssist , resetGoalData + , assignPMins ) where import Control.Monad.Trans.State (modify) @@ -210,3 +211,11 @@ resetGoalData ps = ps & progMode.gameStateL %~ (goalBy .~ Nothing) . (assistsBy .~ []) . (confirmGoalDataFlag .~ False) + +-- | Adds penalty minutes to a player +assignPMins + :: Int + -- ^ The number of minutes to add + -> ProgState + -> ProgState +assignPMins = undefined diff --git a/src/Mtlstats/Prompt.hs b/src/Mtlstats/Prompt.hs index 39511c8..c9b6703 100644 --- a/src/Mtlstats/Prompt.hs +++ b/src/Mtlstats/Prompt.hs @@ -244,7 +244,8 @@ pMinPlayerPrompt = selectPlayerPrompt Just n -> modify $ progMode.gameStateL.selectedPlayer ?~ n assignPMinsPrompt :: Prompt -assignPMinsPrompt = undefined +assignPMinsPrompt = numPrompt "Penalty minutes: " $ + modify . assignPMins drawSimplePrompt :: String -> ProgState -> C.Update () drawSimplePrompt pStr s = C.drawString $ pStr ++ s^.inputBuffer