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