renamed visitorScore to awayScore
This commit is contained in:
@@ -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,
|
||||||
@@ -107,7 +107,7 @@ data ProgState = ProgState
|
|||||||
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
|
||||||
@@ -313,7 +313,7 @@ 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
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ teamPointsSpec = describe "teamPoints" $ do
|
|||||||
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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user