map, player, game, gamemode data now database driven
This commit is contained in:
43
Sources/App/Models/LossReason.swift
Normal file
43
Sources/App/Models/LossReason.swift
Normal file
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// LossReason.swift
|
||||
// App
|
||||
//
|
||||
// Created by Michael Simard on 10/30/21.
|
||||
//
|
||||
|
||||
import Fluent
|
||||
import Vapor
|
||||
|
||||
import Fluent
|
||||
import Vapor
|
||||
|
||||
final class LossReason: Model, Content {
|
||||
// Name of the table or collection.
|
||||
static let schema = "loss_reason"
|
||||
|
||||
@ID(key: .id)
|
||||
var id: UUID?
|
||||
|
||||
@Field(key: "reason_id")
|
||||
var reasonId: Int
|
||||
|
||||
@Field(key: "name")
|
||||
var name: String
|
||||
|
||||
// Creates a new, empty .
|
||||
init() { }
|
||||
|
||||
// Creates a new with all properties set.
|
||||
init(id: UUID? = nil, lossReasonId: Int, name: String) {
|
||||
self.id = id
|
||||
self.reasonId = reasonId
|
||||
self.name = name
|
||||
|
||||
}
|
||||
|
||||
|
||||
var lossReasonConfig: LossReasonConfig {
|
||||
return LossReasonConfig(reasonId: reasonId, name: name)
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user