From b17e63246f3a26e97e025963ef226f06b5497fd4 Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Thu, 3 Oct 2019 01:10:44 -0400 Subject: [PATCH] added gamePlayerStats field to GameState --- package.yaml | 1 + src/Mtlstats/Types.hs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/package.yaml b/package.yaml index 7e50ebb..37e73b9 100644 --- a/package.yaml +++ b/package.yaml @@ -22,6 +22,7 @@ description: Please see the README on GitHub at = 4.7 && < 5 - aeson >= 1.4.4.0 && < 1.5 +- containers >= 0.6.0.1 && < 0.7 - easy-file >= 0.2.2 && < 0.3 - extra >= 1.6.17 && < 1.7 - microlens-th >= 0.4.2.3 && < 0.5 diff --git a/src/Mtlstats/Types.hs b/src/Mtlstats/Types.hs index d438946..ba821b6 100644 --- a/src/Mtlstats/Types.hs +++ b/src/Mtlstats/Types.hs @@ -58,6 +58,7 @@ module Mtlstats.Types ( pointsAccounted, goalBy, assistsBy, + gamePlayerStats, confirmGoalDataFlag, -- ** CreatePlayerState Lenses cpsNumber, @@ -146,6 +147,7 @@ import Data.Aeson , (.=) ) import Data.List (isInfixOf) +import qualified Data.Map as M import Data.Maybe (listToMaybe) import Lens.Micro (Lens', lens, (&), (^.), (.~)) import Lens.Micro.TH (makeLenses) @@ -215,7 +217,10 @@ data GameState = GameState , _assistsBy :: [Int] -- ^ The index numbers of the players who have assisted the most -- recently entered goal + , _gamePlayerStats :: M.Map Int PlayerStats + -- ^ The player stats accumulated over the game , _confirmGoalDataFlag :: Bool + -- ^ Set when the user confirms the goal data } deriving (Eq, Show) -- | The type of game @@ -514,6 +519,7 @@ newGameState = GameState , _pointsAccounted = 0 , _goalBy = Nothing , _assistsBy = [] + , _gamePlayerStats = M.empty , _confirmGoalDataFlag = False }