added express
This commit is contained in:
@@ -511,7 +511,6 @@ struct StatsController: RouteCollection {
|
|||||||
//print ("cw done \(Date().timeIntervalSince(startTime))")
|
//print ("cw done \(Date().timeIntervalSince(startTime))")
|
||||||
|
|
||||||
group.leave()
|
group.leave()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
group.enter()
|
group.enter()
|
||||||
@@ -554,8 +553,7 @@ struct StatsController: RouteCollection {
|
|||||||
mwFivePlayers = self.getStatsByPlayerCount(matches: matches, playerCount: 5)
|
mwFivePlayers = self.getStatsByPlayerCount(matches: matches, playerCount: 5)
|
||||||
group.leave()
|
group.leave()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
group.enter()
|
group.enter()
|
||||||
queue.async {
|
queue.async {
|
||||||
@@ -612,27 +610,18 @@ struct StatsController: RouteCollection {
|
|||||||
|
|
||||||
}
|
}
|
||||||
let ratio = wins / loss
|
let ratio = wins / loss
|
||||||
|
|
||||||
return records
|
return records
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func mapsSortedByBest (records :[ Int:Stats] ) -> [ Int ]
|
func mapsSortedByBest (records :[ Int:Stats] ) -> [ Int ] {
|
||||||
{
|
|
||||||
return records.keys.sorted { (map1, map2) -> Bool in
|
return records.keys.sorted { (map1, map2) -> Bool in
|
||||||
return records[map1]?.getRatioDouble() ?? 0.0 < records[map2]?.getRatioDouble() ?? 0.0
|
return records[map1]?.getRatioDouble() ?? 0.0 < records[map2]?.getRatioDouble() ?? 0.0
|
||||||
}.reversed()
|
}.reversed()
|
||||||
}
|
}
|
||||||
|
|
||||||
func getStatsByPlayerCount(matches:[Match], playerCount:Int) -> Stats {
|
func getStatsByPlayerCount(matches:[Match], playerCount:Int) -> Stats {
|
||||||
|
|
||||||
return getStats(matches: matches.filter{$0.playerList.count == playerCount})
|
return getStats(matches: matches.filter{$0.playerList.count == playerCount})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func getBestMap (records :[ Int:Stats] ) -> Int {
|
func getBestMap (records :[ Int:Stats] ) -> Int {
|
||||||
|
|||||||
@@ -44,12 +44,14 @@ class MapData {
|
|||||||
29: Map(id: 29, name: "Nuketown Holiday", imageName: "bocw_nuketown_holiday"),
|
29: Map(id: 29, name: "Nuketown Holiday", imageName: "bocw_nuketown_holiday"),
|
||||||
30: Map(id: 30, name: "Raid", imageName: "bocw_raid"),
|
30: Map(id: 30, name: "Raid", imageName: "bocw_raid"),
|
||||||
32: Map(id: 32, name: "Piccadilly", imageName: "mw_piccadilly"),
|
32: Map(id: 32, name: "Piccadilly", imageName: "mw_piccadilly"),
|
||||||
33: Map(id: 33, name: "Grazna Raid", imageName: "mw_grazna")
|
33: Map(id: 33, name: "Grazna Raid", imageName: "mw_grazna"),
|
||||||
|
34: Map(id: 34, name: "Express", imageName: "bocw_express")
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
static let bocwMaps = {
|
static let bocwMaps = {
|
||||||
|
|
||||||
return [1,3,8,7,4,2,29,31,5,6,30,0].compactMap {
|
return [1,3,8,7,4,2,29,31,5,6,30,0,34].compactMap {
|
||||||
return allMaps[$0];
|
return allMaps[$0];
|
||||||
}
|
}
|
||||||
.sorted { (m1, m2) -> Bool in
|
.sorted { (m1, m2) -> Bool in
|
||||||
|
|||||||
Reference in New Issue
Block a user