源战役客户端
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.

23 lines
557 B

  1. -- local setmetatable = setmetatable
  2. -- local _slot = {}
  3. -- setmetatable(_slot, _slot)
  4. -- _slot.__call = function(self, ...)
  5. -- if nil == self.obj then
  6. -- return self.func(...)
  7. -- else
  8. -- return self.func(self.obj, ...)
  9. -- end
  10. -- end
  11. -- _slot.__eq = function (lhs, rhs)
  12. -- return lhs.func == rhs.func and lhs.obj == rhs.obj
  13. -- end
  14. -- --可用于 Timer 定时器回调函数. 例如Timer.New(slot(self.func, self))
  15. -- function slot(func, obj)
  16. -- local st = {func = func, obj = obj}
  17. -- setmetatable(st, _slot)
  18. -- return st
  19. -- end