implemented gameLost
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user