implemented gmsGames
This commit is contained in:
@@ -103,6 +103,7 @@ module Mtlstats.Types (
|
||||
gameLost,
|
||||
gameTied,
|
||||
-- ** GameStats Helpers
|
||||
gmsGames,
|
||||
gmsPoints,
|
||||
addGameStats,
|
||||
-- ** Player Helpers
|
||||
@@ -541,6 +542,10 @@ gameLost gs = (<) <$> teamScore gs <*> otherScore gs
|
||||
gameTied :: GameState -> Maybe Bool
|
||||
gameTied gs = (==) <$> gs^.homeScore <*> gs^.awayScore
|
||||
|
||||
-- | Calculates the number of games played
|
||||
gmsGames :: GameStats -> Int
|
||||
gmsGames gs = gs^.gmsWins + gs^.gmsLosses
|
||||
|
||||
-- | Calculates the number of points
|
||||
gmsPoints :: GameStats -> Int
|
||||
gmsPoints gs = 2 * gs^.gmsWins + gs^. gmsOvertime
|
||||
|
||||
Reference in New Issue
Block a user