From 8ef1c6917abe8b6ebba5171795cff5f13370b808 Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Tue, 29 Oct 2019 02:40:17 -0400 Subject: [PATCH] implemented goalieInput dispatcher --- src/Mtlstats/Control/GoalieInput.hs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Mtlstats/Control/GoalieInput.hs b/src/Mtlstats/Control/GoalieInput.hs index 4dad19e..195f806 100644 --- a/src/Mtlstats/Control/GoalieInput.hs +++ b/src/Mtlstats/Control/GoalieInput.hs @@ -21,8 +21,22 @@ along with this program. If not, see . module Mtlstats.Control.GoalieInput (goalieInput) where +import Lens.Micro ((^.)) + import Mtlstats.Types -- | The dispatcher for handling goalie input goalieInput :: GameState -> Controller -goalieInput = undefined +goalieInput gs + | null $ gs^.gameSelectedGoalie = selectGoalieC + | null $ gs^.goalieMinsPlayed = minsPlayedC + | otherwise = goalsAllowedC + +selectGoalieC :: Controller +selectGoalieC = undefined + +minsPlayedC :: Controller +minsPlayedC = undefined + +goalsAllowedC :: Controller +goalsAllowedC = undefined