You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
501 B
24 lines
501 B
2 years ago
|
local Tinkr, Vision = ...
|
||
|
|
||
|
local Timer = Vision.Timer
|
||
|
|
||
|
local TimeManager = {
|
||
|
timers = {},
|
||
|
}
|
||
|
|
||
|
TimeManager.__index = TimeManager
|
||
|
|
||
|
-- Constructor
|
||
|
---@return TimeManager
|
||
|
function TimeManager:New()
|
||
|
local self = setmetatable({}, TimeManager)
|
||
|
self.timers = {}
|
||
|
end
|
||
|
|
||
|
function TimeManager:GetTimer(label, start_events, reset_events)
|
||
|
if self.timers[label] == nil then
|
||
|
self.timers[label] = Timer:New(label, start_events, reset_events)
|
||
|
else
|
||
|
return self.timers[label]
|
||
|
end
|
||
|
end
|