renamed visitorScore to awayScore

This commit is contained in:
Jonathan Lamothe
2019-08-22 03:10:22 -04:00
parent ff19cd9fb5
commit 2e6a0f5ba4
2 changed files with 11 additions and 11 deletions

View File

@@ -39,7 +39,7 @@ module Mtlstats.Types (
-- ** GameState Lenses -- ** GameState Lenses
gameType, gameType,
homeScore, homeScore,
visitorScore, awayScore,
-- ** Database Lenses -- ** Database Lenses
dbPlayers, dbPlayers,
dbGoalies, dbGoalies,
@@ -105,9 +105,9 @@ data ProgState = ProgState
-- | The game state -- | The game state
data GameState = GameState data GameState = GameState
{ _gameType :: Maybe GameType { _gameType :: Maybe GameType
, _homeScore :: Maybe Int , _homeScore :: Maybe Int
, _visitorScore :: Maybe Int , _awayScore :: Maybe Int
} deriving (Eq, Show) } deriving (Eq, Show)
-- | The program mode -- | The program mode
@@ -311,9 +311,9 @@ newProgState = ProgState
-- | Constructor for a 'GameState' -- | Constructor for a 'GameState'
newGameState :: GameState newGameState :: GameState
newGameState = GameState newGameState = GameState
{ _gameType = Nothing { _gameType = Nothing
, _homeScore = Nothing , _homeScore = Nothing
, _visitorScore = Nothing , _awayScore = Nothing
} }
-- | Constructor for a 'Database' -- | Constructor for a 'Database'
@@ -380,7 +380,7 @@ teamPoints :: ProgState -> Maybe Int
teamPoints s = case s ^. progMode of teamPoints s = case s ^. progMode of
NewGame gs -> case gs ^. gameType of NewGame gs -> case gs ^. gameType of
Just HomeGame -> gs ^. homeScore Just HomeGame -> gs ^. homeScore
Just AwayGame -> gs ^. visitorScore Just AwayGame -> gs ^. awayScore
Nothing -> Nothing Nothing -> Nothing
_ -> Nothing _ -> Nothing

View File

@@ -63,9 +63,9 @@ teamPointsSpec :: Spec
teamPointsSpec = describe "teamPoints" $ do teamPointsSpec = describe "teamPoints" $ do
let let
m t = NewGame $ newGameState m t = NewGame $ newGameState
& gameType .~ Just t & gameType .~ Just t
& homeScore .~ Just 1 & homeScore .~ Just 1
& visitorScore .~ Just 2 & awayScore .~ Just 2
s t = newProgState s t = newProgState
& progMode .~ m t & progMode .~ m t