2019-11-09 02:05:51 -05:00
|
|
|
{- |
|
|
|
|
|
|
|
|
mtlstats
|
|
|
|
Copyright (C) 2019 Rhéal Lamothe
|
|
|
|
<rheal.lamothe@gmail.com>
|
|
|
|
|
|
|
|
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 <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
-}
|
|
|
|
|
2019-11-12 23:51:49 -05:00
|
|
|
module Mtlstats.Prompt.EditGoalie
|
|
|
|
( goalieToEditPrompt
|
|
|
|
, editGoalieNumberPrompt
|
2019-11-13 11:34:25 -05:00
|
|
|
, editGoalieNamePrompt
|
2019-11-14 00:44:38 -05:00
|
|
|
, editGoalieYtdGamesPrompt
|
2019-11-14 01:01:30 -05:00
|
|
|
, editGoalieYtdMinsPrompt
|
2019-11-14 01:17:19 -05:00
|
|
|
, editGoalieYtdGoalsPrompt
|
2019-11-14 01:37:58 -05:00
|
|
|
, editGoalieYtdWinsPrompt
|
2019-11-14 01:49:22 -05:00
|
|
|
, editGoalieYtdLossesPrompt
|
2019-11-14 02:00:10 -05:00
|
|
|
, editGoalieYtdTiesPrompt
|
2019-11-12 23:51:49 -05:00
|
|
|
) where
|
2019-11-09 02:05:51 -05:00
|
|
|
|
2019-11-11 15:30:04 -05:00
|
|
|
import Control.Monad.Trans.State (modify)
|
|
|
|
import Lens.Micro ((.~))
|
|
|
|
|
2019-11-12 23:58:17 -05:00
|
|
|
import Mtlstats.Actions.EditGoalie
|
2019-11-11 15:30:04 -05:00
|
|
|
import Mtlstats.Prompt
|
2019-11-09 02:05:51 -05:00
|
|
|
import Mtlstats.Types
|
|
|
|
|
|
|
|
-- | Prompt to select a 'Goalie' for editing
|
|
|
|
goalieToEditPrompt :: Prompt
|
2019-11-11 15:30:04 -05:00
|
|
|
goalieToEditPrompt = selectGoaliePrompt "Goalie to edit: " $
|
|
|
|
modify . (progMode.editGoalieStateL.egsSelectedGoalie .~)
|
2019-11-12 23:51:49 -05:00
|
|
|
|
|
|
|
-- | Prompt to edit a goalie's number
|
|
|
|
editGoalieNumberPrompt :: Prompt
|
2019-11-12 23:58:17 -05:00
|
|
|
editGoalieNumberPrompt = numPrompt "Goalie number: " $
|
2019-11-13 11:06:12 -05:00
|
|
|
modify . editGoalieNumber
|
2019-11-13 11:34:25 -05:00
|
|
|
|
|
|
|
-- | Prompt to edit a goalie's name
|
|
|
|
editGoalieNamePrompt :: Prompt
|
2019-11-13 11:40:02 -05:00
|
|
|
editGoalieNamePrompt = strPrompt "Goalie name: " $
|
|
|
|
modify . editGoalieName
|
2019-11-14 00:44:38 -05:00
|
|
|
|
|
|
|
-- | Prompt to edit a goalie's YTD games played
|
|
|
|
editGoalieYtdGamesPrompt :: Prompt
|
2019-11-14 00:48:41 -05:00
|
|
|
editGoalieYtdGamesPrompt = numPrompt "Year-to-date games played: " $
|
|
|
|
modify . editGoalieYtdGames
|
2019-11-14 01:01:30 -05:00
|
|
|
|
|
|
|
-- | Prompt to edit a goalie's YTD minutes played
|
|
|
|
editGoalieYtdMinsPrompt :: Prompt
|
2019-11-14 01:03:47 -05:00
|
|
|
editGoalieYtdMinsPrompt = numPrompt "Year-to-date minutes played: " $
|
|
|
|
modify . editGoalieYtdMins
|
2019-11-14 01:17:19 -05:00
|
|
|
|
|
|
|
-- | Prompt to edit a goalie's YTD goales allowed
|
|
|
|
editGoalieYtdGoalsPrompt :: Prompt
|
2019-11-14 01:21:46 -05:00
|
|
|
editGoalieYtdGoalsPrompt = numPrompt "Year-to-date goals allowed: " $
|
|
|
|
modify . editGoalieYtdGoals
|
2019-11-14 01:37:58 -05:00
|
|
|
|
|
|
|
-- | Prompt to edit a goalie's YTD wins
|
|
|
|
editGoalieYtdWinsPrompt :: Prompt
|
2019-11-14 01:40:42 -05:00
|
|
|
editGoalieYtdWinsPrompt = numPrompt "Year-to-date wins: " $
|
|
|
|
modify . editGoalieYtdWins
|
2019-11-14 01:49:22 -05:00
|
|
|
|
|
|
|
-- | Prompt to edit a goalie's YTD losses
|
|
|
|
editGoalieYtdLossesPrompt :: Prompt
|
2019-11-14 01:51:59 -05:00
|
|
|
editGoalieYtdLossesPrompt = numPrompt "Year-to-date losses: " $
|
|
|
|
modify . editGoalieYtdLosses
|
2019-11-14 02:00:10 -05:00
|
|
|
|
|
|
|
-- | Prompt to edit a goalie's YTD ties
|
|
|
|
editGoalieYtdTiesPrompt :: Prompt
|
2019-11-14 02:02:06 -05:00
|
|
|
editGoalieYtdTiesPrompt = numPrompt "Year-to-date ties: " $
|
|
|
|
modify . editGoalieYtdTies
|