EventHandler.lua 412 B

12345678910111213141516171819202122232425
  1. class "EventHandler"
  2. function EventHandler:EventHandler(...)
  3. local arg = {...}
  4. for k,v in pairs(arg) do
  5. if type(v) == "table" then
  6. if v.__ptr ~= nil then
  7. arg[k] = v.__ptr
  8. end
  9. end
  10. end
  11. if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then
  12. self.__ptr = Polycore.EventHandler(self)
  13. end
  14. end
  15. function EventHandler:__delete()
  16. if self then Polycore.delete_EventHandler(self.__ptr) end
  17. end