29 lines
837 B
Lua
Executable File
29 lines
837 B
Lua
Executable File
require("GameManager/Constants")
|
|
|
|
---@class TeamStruct
|
|
---@field Id integer Team ID.
|
|
---@field Number integer Team number.
|
|
---@field Faction FactionStruct Faction struct for this team.
|
|
---@field IsSpectator boolean Whether this team's players are spectators.
|
|
TeamStruct = {}
|
|
TeamStruct.__index = TeamStruct
|
|
|
|
---Constructs a new Team object.
|
|
---@param id integer Team ID
|
|
---@param faction string Faction name
|
|
---@param isSpectator boolean Is a Spectator team
|
|
function TeamStruct:New(id, faction, isSpectator)
|
|
local self = setmetatable({}, TeamStruct)
|
|
|
|
self.Id = id
|
|
self.Number = id + 1
|
|
self.Faction = Factions[faction]
|
|
self.IsSpectator = isSpectator
|
|
|
|
return self
|
|
end
|
|
|
|
function TeamStruct:Debug()
|
|
return string.format("Team %d: %s (%d)", self.Number, self.Faction.Name, self.Id)
|
|
end
|