lua(仿單繼承)

--lua仿單繼承 Account = { balance = 0} function Account:new(o) o = o or {} setmetatable(o, self)--Account表自己做爲o的metatable self.__index = self--本身做爲本身的原型 return o end function Account:deposit(v)
相關文章
相關標籤/搜索