implemented otherScore
This commit is contained in:
@@ -95,6 +95,7 @@ module Mtlstats.Types (
|
||||
-- * Helper Functions
|
||||
-- ** GameState Helpers
|
||||
teamScore,
|
||||
otherScore,
|
||||
-- ** Player Helpers
|
||||
pPoints
|
||||
) where
|
||||
@@ -511,6 +512,13 @@ teamScore s = case s ^. gameType of
|
||||
Just AwayGame -> s ^. awayScore
|
||||
Nothing -> Nothing
|
||||
|
||||
-- | Determines the other team's score
|
||||
otherScore :: GameState -> Maybe Int
|
||||
otherScore s = case s ^. gameType of
|
||||
Just HomeGame -> s ^. awayScore
|
||||
Just AwayGame -> s ^. homeScore
|
||||
Nothing -> Nothing
|
||||
|
||||
-- | Calculates a player's points
|
||||
pPoints :: PlayerStats -> Int
|
||||
pPoints s = s^.psGoals + s^.psAssists
|
||||
|
||||
Reference in New Issue
Block a user