map, player, game, gamemode data now database driven

This commit is contained in:
Michael Simard
2021-10-31 00:01:27 -05:00
parent b0b0b7bc60
commit 64a66e28b8
22 changed files with 711 additions and 143 deletions

View File

@@ -47,11 +47,14 @@ final class Match: Model, Content {
var gameMode: Int
@Field(key: "lossReason")
var lossReason: Int
init() { }
init(id: UUID? = nil, map:String?, win:Bool, date:Date, roundsWon:Int?, roundsLost:Int?, codGame:String?, notes:String?, players:String?, sweaty:Bool?, finalKillRuinedPlayerId:Int?, numberOfFinalKillsRuined:Int?,competitive:Bool, gameMode:Int) {
init(id: UUID? = nil, map:String?, win:Bool, date:Date, roundsWon:Int?, roundsLost:Int?, codGame:String?, notes:String?, players:String?, sweaty:Bool?, finalKillRuinedPlayerId:Int?, numberOfFinalKillsRuined:Int?,competitive:Bool, gameMode:Int, lossReason:Int) {
self.id = id
self.map = map
self.win = win
@@ -66,7 +69,7 @@ final class Match: Model, Content {
self.numberOfFinalKillsRuined = numberOfFinalKillsRuined
self.competitive = competitive
self.gameMode = gameMode
self.lossReason = lossReason
}
func update( newMatch:Match) {
@@ -88,6 +91,7 @@ final class Match: Model, Content {
self.numberOfFinalKillsRuined = newMatch.numberOfFinalKillsRuined
self.competitive = newMatch.competitive
self.gameMode = newMatch.gameMode
self.lossReason = newMatch.lossReason
}