Initial commit
This commit is contained in:
26
Data/Scripts/Miscellaneous/GameManager/SpectatorStruct.lua
Normal file
26
Data/Scripts/Miscellaneous/GameManager/SpectatorStruct.lua
Normal file
@@ -0,0 +1,26 @@
|
||||
---@class SpectatorStruct
|
||||
---@field Id integer Player ID.
|
||||
---@field TeamId integer Team ID.
|
||||
---@field Name string Player name.
|
||||
---@field Faction string Faction name.
|
||||
---@field PlayerWrapper table The FoC PlayerWrapper object.
|
||||
SpectatorStruct = {}
|
||||
SpectatorStruct.__index = SpectatorStruct
|
||||
|
||||
---Constructs a new Spectator object.
|
||||
---@param wrapper table FoC PlayerWrapper
|
||||
function SpectatorStruct:New(wrapper)
|
||||
local self = setmetatable({}, SpectatorStruct)
|
||||
|
||||
self.Id = wrapper.Get_ID()
|
||||
self.TeamId = wrapper.Get_Team()
|
||||
self.Name = wrapper.Get_Name()
|
||||
self.Faction = wrapper.Get_Faction_Name()
|
||||
self.PlayerWrapper = wrapper
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
function SpectatorStruct:Debug()
|
||||
return string.format("Spectator %s (%d) on Faction %s, Team %d", self.Name, self.Id, self.Faction, self.TeamId)
|
||||
end
|
||||
Reference in New Issue
Block a user