3 function ObjectRef:init()
4 for _, p in ipairs(self._proto) do
5 if p ~= ObjectRef and p.init then
11 function ObjectRef:add_proto(p)
12 table.insert(self._proto, p)
17 ObjectMgr.metatable = {
18 __index = function(t, k)
19 for _, p in ipairs(t._proto) do
26 __call = function(t, ...)
29 __tostring = function(t)
30 return t.serialize and t:serialize() or "<not serializable>"
34 function ObjectMgr.create()
36 o._proto = {ObjectRef}
37 setmetatable(o, ObjectMgr.metatable)