Initial commit
This commit is contained in:
28
Data/Scripts/Miscellaneous/GameManager/TeamStruct.lua
Executable file
28
Data/Scripts/Miscellaneous/GameManager/TeamStruct.lua
Executable file
@@ -0,0 +1,28 @@
|
||||
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
|
||||
Reference in New Issue
Block a user