diff options
Diffstat (limited to 'common/class.lua')
-rw-r--r-- | common/class.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/common/class.lua b/common/class.lua index 37cf7bd..f5cd46e 100644 --- a/common/class.lua +++ b/common/class.lua @@ -1,3 +1,9 @@ +-- currently a class is a table T with T.__index = T +-- then to make an instance of this class, we do setmetatable(instance,T) +-- this should be fine for anything we wish to do. it is possible we will eventually +-- split this into two separate tables though, perhaps? i don't see why we would ever +-- do this though. + local function class() local T = {} T.__index = T @@ -13,6 +19,7 @@ local function extend(Base) end end setmetatable(T,{__index=Base}) + return T end return setmetatable({ |