From dcbd68cdda3ecbd3b6a86653626fa8795ea20d37 Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Thu, 16 Jan 2020 20:37:31 -0500 Subject: [PATCH] implemented editHomeStandingsC and editAwayStandingsC --- src/Mtlstats/Control/EditStandings.hs | 25 +++++++++-- src/Mtlstats/Prompt/EditStandings.hs | 65 +++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 4 deletions(-) create mode 100644 src/Mtlstats/Prompt/EditStandings.hs diff --git a/src/Mtlstats/Control/EditStandings.hs b/src/Mtlstats/Control/EditStandings.hs index 4d182d6..04082dd 100644 --- a/src/Mtlstats/Control/EditStandings.hs +++ b/src/Mtlstats/Control/EditStandings.hs @@ -29,7 +29,10 @@ import qualified UI.NCurses as C import Mtlstats.Format import Mtlstats.Menu import Mtlstats.Menu.EditStandings +import Mtlstats.Prompt +import Mtlstats.Prompt.EditStandings import Mtlstats.Types +import Mtlstats.Types.Menu -- | Controller for the edit standings menu editStandingsC :: EditStandingsMode -> Controller @@ -40,13 +43,27 @@ editStandingsC = \case editHomeStandingsC :: ESMSubMode -> Controller editHomeStandingsC = \case - ESMSubMenu -> menuControllerWith header editHomeStandingsMenu - _ -> undefined + ESMSubMenu -> menuC editHomeStandingsMenu + ESMEditWins -> promptC editHomeWinsPrompt + ESMEditLosses -> promptC editHomeLossesPrompt + ESMEditOvertime -> promptC editHomeOvertimePrompt + ESMEditGoalsFor -> promptC editHomeGoalsForPrompt + ESMEditGoalsAgainst -> promptC editHomeGoalsAgainstPrompt editAwayStandingsC :: ESMSubMode -> Controller editAwayStandingsC = \case - ESMSubMenu -> menuControllerWith header editAwayStandingsMenu - _ -> undefined + ESMSubMenu -> menuC editAwayStandingsMenu + ESMEditWins -> promptC editAwayWinsPrompt + ESMEditLosses -> promptC editAwayLossesPrompt + ESMEditOvertime -> promptC editAwayOvertimePrompt + ESMEditGoalsFor -> promptC editAwayGoalsForPrompt + ESMEditGoalsAgainst -> promptC editAwayGoalsAgainstPrompt + +menuC :: Menu () -> Controller +menuC = menuControllerWith header + +promptC :: Prompt -> Controller +promptC = promptControllerWith header header :: ProgState -> C.Update () header = do diff --git a/src/Mtlstats/Prompt/EditStandings.hs b/src/Mtlstats/Prompt/EditStandings.hs new file mode 100644 index 0000000..2aeced0 --- /dev/null +++ b/src/Mtlstats/Prompt/EditStandings.hs @@ -0,0 +1,65 @@ +{- | + +mtlstats +Copyright (C) 1984, 1985, 2019, 2020 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.Prompt.EditStandings + ( editHomeWinsPrompt + , editHomeLossesPrompt + , editHomeOvertimePrompt + , editHomeGoalsForPrompt + , editHomeGoalsAgainstPrompt + , editAwayWinsPrompt + , editAwayLossesPrompt + , editAwayOvertimePrompt + , editAwayGoalsForPrompt + , editAwayGoalsAgainstPrompt + ) where + +import Mtlstats.Types + +editHomeWinsPrompt :: Prompt +editHomeWinsPrompt = undefined + +editHomeLossesPrompt :: Prompt +editHomeLossesPrompt = undefined + +editHomeOvertimePrompt :: Prompt +editHomeOvertimePrompt = undefined + +editHomeGoalsForPrompt :: Prompt +editHomeGoalsForPrompt = undefined + +editHomeGoalsAgainstPrompt :: Prompt +editHomeGoalsAgainstPrompt = undefined + +editAwayWinsPrompt :: Prompt +editAwayWinsPrompt = undefined + +editAwayLossesPrompt :: Prompt +editAwayLossesPrompt = undefined + +editAwayOvertimePrompt :: Prompt +editAwayOvertimePrompt = undefined + +editAwayGoalsForPrompt :: Prompt +editAwayGoalsForPrompt = undefined + +editAwayGoalsAgainstPrompt :: Prompt +editAwayGoalsAgainstPrompt = undefined