implemented gmsPoints

This commit is contained in:
Jonathan Lamothe
2019-08-30 18:57:56 -04:00
parent 4c13cc9103
commit 9e855d9672
2 changed files with 27 additions and 0 deletions
+6
View File
@@ -97,6 +97,8 @@ module Mtlstats.Types (
gameWon,
gameLost,
gameTied,
-- ** GameStats Helpers
gmsPoints,
-- ** Player Helpers
pPoints
) where
@@ -506,6 +508,10 @@ gameLost gs = (<) <$> teamScore gs <*> otherScore gs
gameTied :: GameState -> Maybe Bool
gameTied gs = (==) <$> gs^.homeScore <*> gs^.awayScore
-- | Calculates the number of points
gmsPoints :: GameStats -> Int
gmsPoints gs = 2 * gs^.gmsWins + gs^. gmsOvertime
-- | Calculates a player's points
pPoints :: PlayerStats -> Int
pPoints s = s^.psGoals + s^.psAssists