added gamePlayerStats field to GameState
This commit is contained in:
parent
9977a73da4
commit
b17e63246f
|
@ -22,6 +22,7 @@ description: Please see the README on GitHub at <https://github.com/jlam
|
|||
dependencies:
|
||||
- base >= 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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user