From 28a29e2f641f2510e05830609cf05a7f8476cfb3 Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Tue, 29 Oct 2019 02:00:14 -0400 Subject: [PATCH] control flow branch for goalie input --- src/Mtlstats/Control.hs | 2 ++ src/Mtlstats/Control/GoalieInput.hs | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 src/Mtlstats/Control/GoalieInput.hs diff --git a/src/Mtlstats/Control.hs b/src/Mtlstats/Control.hs index f5690a3..688f788 100644 --- a/src/Mtlstats/Control.hs +++ b/src/Mtlstats/Control.hs @@ -31,6 +31,7 @@ import Lens.Micro.Extras (view) import qualified UI.NCurses as C import Mtlstats.Actions +import Mtlstats.Control.GoalieInput import Mtlstats.Format import Mtlstats.Handlers import Mtlstats.Menu @@ -58,6 +59,7 @@ dispatch s = case s^.progMode of | fromJust (unaccountedPoints gs) -> goalInput gs | isJust $ gs^.selectedPlayer -> getPMinsC | not $ gs^.pMinsRecorded -> pMinPlayerC + | not $ gs^.goaliesRecorded -> goalieInput gs | otherwise -> reportC CreatePlayer cps | null $ cps^.cpsNumber -> getPlayerNumC diff --git a/src/Mtlstats/Control/GoalieInput.hs b/src/Mtlstats/Control/GoalieInput.hs new file mode 100644 index 0000000..4dad19e --- /dev/null +++ b/src/Mtlstats/Control/GoalieInput.hs @@ -0,0 +1,28 @@ +{- | + +mtlstats +Copyright (C) 2019 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.Control.GoalieInput (goalieInput) where + +import Mtlstats.Types + +-- | The dispatcher for handling goalie input +goalieInput :: GameState -> Controller +goalieInput = undefined