diff --git a/ChangeLog.md b/ChangeLog.md index 2ed10c0..efb1001 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -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 diff --git a/src/Mtlstats/Report.hs b/src/Mtlstats/Report.hs index 0e72b00..384fb79 100644 --- a/src/Mtlstats/Report.hs +++ b/src/Mtlstats/Report.hs @@ -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