do local a={}setmetatable(a,{__mode="k"})local function b(c)t2={}for d,e in pairs(c)do t2[d]=e end;return t2 end;local function f(g,...)local function h(g,i)local j=b(i)a[j]={obj=j,class=g}if g:super()~=nil then j.super=h(g:super(),i)a[j].super=a[j.super]a[j.super].lower=a[j]else j.super={}end;setmetatable(j,g.static)return j end;local j=h(g,a[g].virtuals)j:init(...)return j end;local function k(g,l)local m=g.static[l]if m==nil then m=function()error("Attempt to call an undefined abstract method '"..l.."'")end end;a[g].virtuals[l]=m end;local function n(g,j)local o=a[j]if o.class==g then return j end;while o~=nil do if o.class==g then return o.obj end;o=o.lower end;o=a[j].super;while o~=nil do if o.class==g then return o.obj end;o=o.super end;return nil end;local function p(g,j)local q=n(g,j)if q==nil then error("Failed to cast "..tostring(j).." to a "..g:name())end;return q end;local function r(g,s)if a[s]==nil then return false end;return n(g,s)~=nil end;local t;local u;local function v(j,...)return u(t,...)end;local function w(j,...)j.super:init()end;local function x(j,y,z)if j.super[y]~=nil then j.super[y]=z else rawset(j,y,z)end end;local function A(B,C)if type(C)~="string"then C="Unnamed"end;local D={}local E=B.static;local F={__tostring=E.__tostring,__eq=E.__eq,__add=E.__add,__sub=E.__sub,__mul=E.__mul,__div=E.__div,__mod=E.__mod,__pow=E.__pow,__unm=E.__unm,__len=E.__len,__lt=E.__lt,__le=E.__le,__concat=E.__concat,__call=E.__call}F.init=w;F.__newindex=x;function F.class()return D end;function F.__index(j,y)local G=F[y]if G~=nil then return G end;G=j.super[y]if type(G)=='function'and G~=v then t=j.super;u=G;return v end;return G end;local H={static=F,made=r,new=f,subclass=A,virtual=k,cast=p,trycast=n}a[D]={virtuals=b(a[B].virtuals)}function H.name(g)return C end;function H.super(g)return B end;function H.inherits(g,I)return B==I or B:inherits(I)end;local function J(g,C,K)F[C]=K;if a[g].virtuals[C]~=nil then a[g].virtuals[C]=K end end;local function L()return"class "..C end;setmetatable(D,{__newindex=J,__index=H,__tostring=L,__call=f})return D end;Object={}local function M()error"May not modify the class 'Object'. Subclass it instead."end;local N={}function N.init(j,...)end;N.__index=N;N.__newindex=M;function N.class()return Object end;function N.__tostring(j)return"a "..j:class():name()end;local O={static=N,made=r,new=f,subclass=A,cast=p,trycast=n}function O.name(g)return"Object"end;function O.super(g)return nil end;function O.inherits(g,I)return false end;a[Object]={virtuals={}}local function L()return"class Object"end;setmetatable(Object,{__newindex=M,__index=O,__tostring=L,__call=f})function class(C,B)B=B or Object;return B:subclass(C)end end