From 3dfbfe7090a5d47eb88b8fb48f41889e6bd2d333 Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Mon, 11 Nov 2019 20:38:20 -0500 Subject: [PATCH] implemented Mtlstats.Control.EditGoalie.editC --- src/Mtlstats/Control/EditGoalie.hs | 68 ++++++++++++++++++++++++++++-- src/Mtlstats/Menu.hs | 5 +++ 2 files changed, 70 insertions(+), 3 deletions(-) diff --git a/src/Mtlstats/Control/EditGoalie.hs b/src/Mtlstats/Control/EditGoalie.hs index 52815b3..aecd0db 100644 --- a/src/Mtlstats/Control/EditGoalie.hs +++ b/src/Mtlstats/Control/EditGoalie.hs @@ -19,6 +19,8 @@ along with this program. If not, see . -} +{-# LANGUAGE LambdaCase #-} + module Mtlstats.Control.EditGoalie (editGoalieC) where import Lens.Micro ((^.)) @@ -31,10 +33,70 @@ import Mtlstats.Types editGoalieC :: EditGoalieState -> Controller editGoalieC egs | null $ egs^.egsSelectedGoalie = selectC - | otherwise = editC + | otherwise = editC $ egs^.egsMode selectC :: Controller selectC = promptController goalieToEditPrompt -editC :: Controller -editC = undefined +editC :: EditGoalieMode -> Controller +editC = \case + EGMenu -> menuC + EGNumber -> numberC + EGName -> nameC + EGYtdGames -> ytdGamesC + EGYtdMins -> ytdMinsC + EGYtdGoals -> ytdGoalsC + EGYtdWins -> ytdWinsC + EGYtdLosses -> ytdLossesC + EGYtdTies -> ytdTiesC + EGLtGames -> ltGamesC + EGLtMins -> ltMinsC + EGLtGoals -> ltGoalsC + EGLtWins -> ltWinsC + EGLtLosses -> ltLossesC + EGLtTies -> ltTiesC + +menuC :: Controller +menuC = undefined + +numberC :: Controller +numberC = undefined + +nameC :: Controller +nameC = undefined + +ytdGamesC :: Controller +ytdGamesC = undefined + +ytdMinsC :: Controller +ytdMinsC = undefined + +ytdGoalsC :: Controller +ytdGoalsC = undefined + +ytdWinsC :: Controller +ytdWinsC = undefined + +ytdLossesC :: Controller +ytdLossesC = undefined + +ytdTiesC :: Controller +ytdTiesC = undefined + +ltGamesC :: Controller +ltGamesC = undefined + +ltMinsC :: Controller +ltMinsC = undefined + +ltGoalsC :: Controller +ltGoalsC = undefined + +ltWinsC :: Controller +ltWinsC = undefined + +ltLossesC :: Controller +ltLossesC = undefined + +ltTiesC :: Controller +ltTiesC = undefined diff --git a/src/Mtlstats/Menu.hs b/src/Mtlstats/Menu.hs index 1ba882e..6112cd3 100644 --- a/src/Mtlstats/Menu.hs +++ b/src/Mtlstats/Menu.hs @@ -30,6 +30,7 @@ module Mtlstats.Menu ( gameMonthMenu, gameTypeMenu, editPlayerMenu, + editGoalieMenu, gameGoalieMenu ) where @@ -158,6 +159,10 @@ editPlayerMenu = Menu "*** EDIT PLAYER ***" () $ map , ( '0', "Finished editing", Nothing ) ] +-- | The 'Goalie' edit menu +editGoalieMenu :: Menu () +editGoalieMenu = undefined + -- | Game goalie selection menu gameGoalieMenu :: ProgState -> Menu () gameGoalieMenu s = let