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
gameType,
homeScore,
visitorScore,
awayScore,
-- ** Database Lenses
dbPlayers,
dbGoalies,
@@ -107,7 +107,7 @@ data ProgState = ProgState
data GameState = GameState
{ _gameType :: Maybe GameType
, _homeScore :: Maybe Int
, _visitorScore :: Maybe Int
, _awayScore :: Maybe Int
} deriving (Eq, Show)
-- | The program mode
@@ -313,7 +313,7 @@ newGameState :: GameState
newGameState = GameState
{ _gameType = Nothing
, _homeScore = Nothing
, _visitorScore = Nothing
, _awayScore = Nothing
}
-- | Constructor for a 'Database'
@@ -380,7 +380,7 @@ teamPoints :: ProgState -> Maybe Int
teamPoints s = case s ^. progMode of
NewGame gs -> case gs ^. gameType of
Just HomeGame -> gs ^. homeScore
Just AwayGame -> gs ^. visitorScore
Just AwayGame -> gs ^. awayScore
Nothing -> Nothing
_ -> Nothing

View File

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