local _class={} local function class(super)local class_type={}class_type.ctor=falseclass_type.super=superclass_type.new=function(...) local obj={}dolocal createcreate = function(c,...)if c.super thencreate(c.super,...)endif c.ctor thenc.ctor(obj,...)endend create(class_type,...)endsetmetatable(obj,{ __index=_class[class_type] })return objendlocal vtbl={}_class[class_type]=vtbl setmetatable(class_type,{__newindex=function(t,k,v)vtbl[k]=vend}) if super thensetmetatable(vtbl,{__index=function(t,k)local ret=_class[super][k]vtbl[k]=retreturn retend})end return class_typeendlocal function get_class(class_type)return _class[class_type]endlocal Dict={}Dict.new=function()local obj={}setmetatable(obj,{__mode="k"})return objendreturn { class=class, Dict=Dict, get_class=get_class}