TimerManager.lua 677 B

12345678910111213141516171819202122232425262728293031323334
  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. Polycore.__ptr_lookup[self.__ptr] = self
  13. end
  14. end
  15. function TimerManager:removeTimer(timer)
  16. local retVal = Polycore.TimerManager_removeTimer(self.__ptr, timer.__ptr)
  17. end
  18. function TimerManager:addTimer(timer)
  19. local retVal = Polycore.TimerManager_addTimer(self.__ptr, timer.__ptr)
  20. end
  21. function TimerManager:Update()
  22. local retVal = Polycore.TimerManager_Update(self.__ptr)
  23. end