Merge pull request #46 from mtlstats/remove-extra-stats

removed unnecessary goalie stats from game report
This commit is contained in:
Jonathan Lamothe 2019-12-02 20:23:58 -05:00 committed by GitHub
commit d5ac42268f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 1 deletions

View File

@ -4,6 +4,7 @@
- Bugfix: removed quotation marks from goalie names in report
- Allow lower case player names
- Don't show players without points in game report
- Removed unnecessary goalie statistics from game report
## 0.7.0
- Shortened views to fit within 25 lines

View File

@ -129,7 +129,7 @@ gameStatsReport width s = let
in filteredPlayerReport width "GAME" criteria playerStats
++ [""]
++ goalieReport width goalieStats
++ gameGoalieReport width goalieStats
yearToDateStatsReport :: Int -> ProgState -> [String]
yearToDateStatsReport width s = let
@ -266,3 +266,27 @@ goalieReport width goalieData = let
$ overlayLast olayText
$ complexTable ([right, left] ++ repeat right)
$ header : body ++ [separator, summary]
gameGoalieReport :: Int -> [(Goalie, GoalieStats)] -> [String]
gameGoalieReport width goalieData = let
header =
[ CellText "NO."
, CellText "GOALTENDER"
, CellText " MIN"
, CellText " GA"
, CellText " AVE"
]
body = map
(\(goalie, stats) ->
[ CellText $ show (goalie^.gNumber) ++ " "
, CellText $ goalie^.gName
, CellText $ show $ stats^.gsMinsPlayed
, CellText $ show $ stats^.gsGoalsAllowed
, CellText $ showFloating $ gsAverage stats
])
goalieData
in map (centre width)
$ complexTable ([right, left] ++ repeat right)
$ header : body