Advertisement
Guest User

Untitled

a guest
Dec 27th, 2017
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. --[=[
  2. * Class.lua is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  5. *
  6. * Original author: @hydroper
  7. * All rights reserved.
  8. --]=]
  9. do local a=getmetatable;local b=setmetatable;local c=rawget;local d=rawset;local e,f;local g=1;local h=2;local i=3;local j=4;local k,l,m,n;local o,p,q;function f(r,s)local t={__index=l,__newindex=m,proto={},macro={}}if s then local u=c(s,j)if not u then u={__index=s.Macro}d(s,j,u)end;b(t.macro,u)b(t.proto,c(s,g))end;r[g]=t;r[h]=n;r[i]=s;b(r,q)end;function k(r,...)local v=b({},c(r,g))c(r,h)(v,...)return v end;function l(self,w)local x=a(self)local y=x.macro[w]if y then return y.Get(self)end;y=c(self,w)if y~=nil then return y end;return x.proto[w]end;function m(self,w,z)local x=a(self)local y=x.macro[w]if y and y.Set then return y.Set(self,z)end;d(self,w,z)end;function n()end;function e(z,s)s=c(s,g)z=a(z)repeat if z==s then return true end;z=a(z.proto)until z==nil;return false end;local function A(self,s)f(self,s)end;p={Base=function(self,B,...)c(c(self,i),h)(B,...)end,Test=function(self,C)return a(C)==c(self,g)end,DeepTest=function(...)return e(...)end}local D={Proto={Get=function(self)return c(self,g).proto end},Macro={Get=function(self)return c(self,g).macro end},New={Get=function(self)return c(self,h)end,Set=function(self,u)self[h]=u end}}q={__call=k,__index=l,__newindex=m,proto=p,macro=D}o=b({q,A,o,false},q)Class=o end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement