From 8aa8d39f705ba800379a940648f6ef93d771ddb3 Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Mon, 11 Nov 2019 15:30:04 -0500 Subject: [PATCH] implemented goalieToEditPrompt --- src/Mtlstats/Prompt/EditGoalie.hs | 7 ++++++- src/Mtlstats/Types.hs | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Mtlstats/Prompt/EditGoalie.hs b/src/Mtlstats/Prompt/EditGoalie.hs index d80041f..99f9c26 100644 --- a/src/Mtlstats/Prompt/EditGoalie.hs +++ b/src/Mtlstats/Prompt/EditGoalie.hs @@ -21,8 +21,13 @@ along with this program. If not, see . module Mtlstats.Prompt.EditGoalie (goalieToEditPrompt) where +import Control.Monad.Trans.State (modify) +import Lens.Micro ((.~)) + +import Mtlstats.Prompt import Mtlstats.Types -- | Prompt to select a 'Goalie' for editing goalieToEditPrompt :: Prompt -goalieToEditPrompt = undefined +goalieToEditPrompt = selectGoaliePrompt "Goalie to edit: " $ + modify . (progMode.editGoalieStateL.egsSelectedGoalie .~) diff --git a/src/Mtlstats/Types.hs b/src/Mtlstats/Types.hs index cc548bf..6e1c3a9 100644 --- a/src/Mtlstats/Types.hs +++ b/src/Mtlstats/Types.hs @@ -54,6 +54,7 @@ module Mtlstats.Types ( createPlayerStateL, createGoalieStateL, editPlayerStateL, + editGoalieStateL, -- ** GameState Lenses gameYear, gameMonth, @@ -651,6 +652,9 @@ editPlayerStateL = lens _ -> newEditPlayerState) (\_ eps -> EditPlayer eps) +editGoalieStateL :: Lens' ProgMode EditGoalieState +editGoalieStateL = undefined + -- | Constructor for a 'ProgState' newProgState :: ProgState newProgState = ProgState