TimerManager.lua 634 B

123456789101112131415161718192021222324252627282930313233
  1. class "TimerManager"
  2. function TimerManager:TimerManager(...)
  3. for k,v in pairs(arg) do
  4. if type(v) == "table" then
  5. if v.__ptr ~= nil then
  6. arg[k] = v.__ptr
  7. end
  8. end
  9. end
  10. if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then
  11. self.__ptr = Polycore.TimerManager(unpack(arg))
  12. end
  13. end
  14. function TimerManager:removeTimer(timer)
  15. local retVal = Polycore.TimerManager_removeTimer(self.__ptr, timer.__ptr)
  16. end
  17. function TimerManager:addTimer(timer)
  18. local retVal = Polycore.TimerManager_addTimer(self.__ptr, timer.__ptr)
  19. end
  20. function TimerManager:Update()
  21. local retVal = Polycore.TimerManager_Update(self.__ptr)
  22. end