From 4688588b56b875b3b776e0dc3c10eab39faec5a1 Mon Sep 17 00:00:00 2001 From: Michael Simard Date: Thu, 16 Sep 2021 10:13:11 -0500 Subject: [PATCH] vanguard maps added --- Sources/App/Controllers/StatsController.swift | 4 +--- Sources/App/Data/MapData.swift | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/Sources/App/Controllers/StatsController.swift b/Sources/App/Controllers/StatsController.swift index e08573d..8fb3f3a 100644 --- a/Sources/App/Controllers/StatsController.swift +++ b/Sources/App/Controllers/StatsController.swift @@ -27,13 +27,11 @@ struct StatsController: RouteCollection { statsRoute.get("maps","game",":game","competitive",":competitive",use: mapRecords) statsRoute.get("maps","game",":game","competitive",":competitive", "gamemode", ":gamemode",use: mapRecords) statsRoute.get("dashboard", use: dashboard) - statsRoute.get("stats","q",":query", use: history) - } - func dashboard(db: Database) throws -> EventLoopFuture { + func dashboard(db: Database) throws -> EventLoopFuture { let statistics = WinLossRecords.query(on: db).all() let adamAffectedMatches = Match.query(on: db).filter(\.$finalKillRuinedPlayerId == 6).count() let totalMWGames = Match.query(on: db).filter(\.$codGame == "mw").count() diff --git a/Sources/App/Data/MapData.swift b/Sources/App/Data/MapData.swift index 8b45ddc..cafdb57 100644 --- a/Sources/App/Data/MapData.swift +++ b/Sources/App/Data/MapData.swift @@ -77,6 +77,16 @@ class MapData { 60: Map(id: 60, name: "Zoo", imageName: "bocw_zoo"), + + + 61: Map(id: 61, name: "Champion Hill", imageName: "vg_championhill"), + 62: Map(id: 62, name: "Hotel Royal", imageName: "vg_hotel"), + 63: Map(id: 63, name: "Red Star", imageName: "vg_redstar"), + 64: Map(id: 64, name: "Gavutu", imageName: "vg_gavutu"), + 65: Map(id: 65, name: "Eagle’s Nest", imageName: "vg_eaglesnest"), + + + ] static let bocwMaps = { @@ -90,12 +100,19 @@ class MapData { } static let mwMaps = { return [9,10,11,12,13,14,15,28,16,17,18,19,20,21,22,23,24,25,26,27,32,33,36,37].compactMap { - return allMaps[$0]; + return allMaps[$0] }.sorted { (m1, m2) -> Bool in return m1.name < m2.name } } + static let vgMaps = { + return [61,62,63,64,65].compactMap { + return allMaps[$0]; + }.sorted { (m1, m2) -> Bool in + return m1.name < m2.name + } + } }