function class(classname, super) local superType = type(super) local cls if superType ~= "table" then superType = nil super = nil end if super then cls = {} setmetatable(cls, {__index = super}) cls.super = super else cls = {ctor = function() end} end cls.__cna…