Faster stat processing
This commit is contained in:
@@ -26,17 +26,22 @@ struct DataPoint : Content {
|
||||
|
||||
final class AllStats: Content {
|
||||
var overall:Stats
|
||||
var mwStats:Stats
|
||||
var bocwStats:Stats
|
||||
var byMonth: [MonthStats]
|
||||
var highestWinLossRatio:String
|
||||
var dataPoints:[DataPoint]
|
||||
var mostRecentRecord:String
|
||||
|
||||
init( overall:Stats, byMonth:[MonthStats], highestWinLossRatio:String, dataPoints:[DataPoint], mostRecentRecord:String) {
|
||||
init( overall:Stats, mwStats:Stats, bocwStats:Stats, byMonth:[MonthStats], highestWinLossRatio:String, dataPoints:[DataPoint], mostRecentRecord:String) {
|
||||
self.overall = overall
|
||||
self.byMonth = byMonth
|
||||
self.highestWinLossRatio = highestWinLossRatio
|
||||
self.dataPoints = dataPoints
|
||||
self.mostRecentRecord = mostRecentRecord
|
||||
self.mwStats = mwStats;
|
||||
self.bocwStats = bocwStats;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,16 +22,19 @@ final class Match: Model, Content {
|
||||
@Field(key: "roundsLost")
|
||||
var roundsLost: Int?
|
||||
|
||||
@Field(key: "codGame")
|
||||
var codGame: String
|
||||
|
||||
init() { }
|
||||
|
||||
init(id: UUID? = nil, map:String?, win:Bool, date:Date, roundsWon:Int?, roundsLost:Int?) {
|
||||
init(id: UUID? = nil, map:String?, win:Bool, date:Date, roundsWon:Int?, roundsLost:Int?, codGame:String) {
|
||||
self.id = id
|
||||
self.map = map
|
||||
self.win = win
|
||||
self.date = date
|
||||
self.roundsWon = roundsWon
|
||||
self.roundsLost = roundsLost
|
||||
self.codGame = codGame;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user