From 0e4c0ef7c182a5549145a9a62aef40b2335d4df8 Mon Sep 17 00:00:00 2001 From: Michael Simard Date: Tue, 22 Dec 2020 11:33:27 -0600 Subject: [PATCH] Remove data point calucations for now --- Sources/App/Controllers/StatsController.swift | 16 ++++++++-------- Sources/App/Models/AllStats.swift | 6 +----- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/Sources/App/Controllers/StatsController.swift b/Sources/App/Controllers/StatsController.swift index 856a487..7c78db5 100644 --- a/Sources/App/Controllers/StatsController.swift +++ b/Sources/App/Controllers/StatsController.swift @@ -263,20 +263,20 @@ struct StatsController: RouteCollection { // print ( Date().timeIntervalSince(startTime)) - let cumulativeWinLossRatios = self.getCumulativeWinLossRatios(matches: matches) + // let cumulativeWinLossRatios = self.getCumulativeWinLossRatios(matches: matches) // print ( Date().timeIntervalSince(startTime)) - let highestWinLossRatio = cumulativeWinLossRatios.reduce("0") { (highestRatio, dataPoint) -> String in - if dataPoint.y > Double(highestRatio)!{ - return String(dataPoint.y) - } - return highestRatio - } +// let highestWinLossRatio = cumulativeWinLossRatios.reduce("0") { (highestRatio, dataPoint) -> String in +// if dataPoint.y > Double(highestRatio)!{ +// return String(dataPoint.y) +// } +// return highestRatio +// } // print ( Date().timeIntervalSince(startTime)) - return AllStats.init(overall: overallStats,mwStats: mwStats, bocwStats: bocwStats, byMonth: monthlyStats, highestWinLossRatio: highestWinLossRatio, dataPoints: cumulativeWinLossRatios, mostRecentRecord: "\(mostRecentDailyStats.totalWins) - \(mostRecentDailyStats.totalLosses)") + return AllStats.init(overall: overallStats,mwStats: mwStats, bocwStats: bocwStats, byMonth: monthlyStats, mostRecentRecord: "\(mostRecentDailyStats.totalWins) - \(mostRecentDailyStats.totalLosses)") } diff --git a/Sources/App/Models/AllStats.swift b/Sources/App/Models/AllStats.swift index 485b704..12305fa 100644 --- a/Sources/App/Models/AllStats.swift +++ b/Sources/App/Models/AllStats.swift @@ -29,15 +29,11 @@ final class AllStats: Content { var mwStats:StatsWithMostRecentDailyRecord var bocwStats:StatsWithMostRecentDailyRecord var byMonth: [MonthStats] - var highestWinLossRatio:String - var dataPoints:[DataPoint] var mostRecentRecord:String - init( overall:StatsWithMostRecentDailyRecord, mwStats:StatsWithMostRecentDailyRecord, bocwStats:StatsWithMostRecentDailyRecord, byMonth:[MonthStats], highestWinLossRatio:String, dataPoints:[DataPoint], mostRecentRecord:String) { + init( overall:StatsWithMostRecentDailyRecord, mwStats:StatsWithMostRecentDailyRecord, bocwStats:StatsWithMostRecentDailyRecord, byMonth:[MonthStats], mostRecentRecord:String) { self.overall = overall self.byMonth = byMonth - self.highestWinLossRatio = highestWinLossRatio - self.dataPoints = dataPoints self.mostRecentRecord = mostRecentRecord self.mwStats = mwStats; self.bocwStats = bocwStats;