
LUA
v2nero
这个作者很懒,什么都没留下…
展开
-
LUA单继承与多继承实验
-- base Class Object CObject = { _obj_name = "CObject"} function CObject:new (o) if (o and type(o) ~= "table") then error("base object is not a table") end o = o or {} setmetatable(o, self) se原创 2016-08-27 19:47:41 · 601 阅读 · 0 评论 -
LUA元表的正确理解
TableA = {} function TableA:f1() print("TableA") end mt = {} function mt:__tostring() return "mt." .. tostring(self) end function mt:f2() print("mt") end mt__index = {} function mt__index:f2()原创 2016-08-28 19:44:44 · 536 阅读 · 0 评论