Last active
December 28, 2015 17:09
-
-
Save tangzero/7534039 to your computer and use it in GitHub Desktop.
Gideros Class-Commons interface.
see https://github.com/bartbes/Class-Commons
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Interface for cross class-system compatibility | |
-- see https://github.com/bartbes/Class-Commons. | |
if common_class ~= false then | |
common = {} | |
function common.class(name, prototype, parent) | |
local class = parent and Core.class(parent) or Core.class() | |
local class.__name = name | |
if prototype then | |
for k, v in pairs(prototype) do | |
class[k] = v | |
end | |
end | |
return class | |
end | |
function common.instance(class, ...) | |
return class.new(...) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment