classCombat:GetTimeData(chartName) now check if the combat has a TimeData table or return an empty table; Added classCombat:EraseTimeData(chartName)
This commit is contained in:
@@ -91,9 +91,24 @@
|
||||
end
|
||||
end
|
||||
|
||||
--return data for charts
|
||||
---return a table representing a chart data
|
||||
---@param name string
|
||||
---@return number[]
|
||||
function classCombat:GetTimeData(name)
|
||||
return self.TimeData[name]
|
||||
if (self.TimeData) then
|
||||
return self.TimeData[name]
|
||||
end
|
||||
return {max_value = 0}
|
||||
end
|
||||
|
||||
---erase a time data if exists
|
||||
---@param name string
|
||||
function classCombat:EraseTimeData(name)
|
||||
if (self.TimeData[name]) then
|
||||
self.TimeData[name] = nil
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function classCombat:GetContainer(attribute)
|
||||
|
||||
@@ -229,6 +229,7 @@
|
||||
tickTime = 0
|
||||
|
||||
--return the capture table the to combat object
|
||||
--the return value goes into combatObject.TimeData = @chartTables
|
||||
return chartTables
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user