implemented gameLost

This commit is contained in:
Jonathan Lamothe
2019-08-30 00:44:40 -04:00
parent 3fe2ff10f6
commit a9d952b97b
2 changed files with 34 additions and 0 deletions
+5
View File
@@ -95,6 +95,7 @@ module Mtlstats.Types (
teamScore,
otherScore,
gameWon,
gameLost,
gameTied,
-- ** Player Helpers
pPoints
@@ -497,6 +498,10 @@ otherScore s = case s ^. gameType of
gameWon :: GameState -> Maybe Bool
gameWon gs = (>) <$> teamScore gs <*> otherScore gs
-- | Checks if the game was lost
gameLost :: GameState -> Maybe Bool
gameLost gs = (<) <$> teamScore gs <*> otherScore gs
-- | Checks if the game has tied
gameTied :: GameState -> Maybe Bool
gameTied gs = (==) <$> gs^.homeScore <*> gs^.awayScore