Skip to content

Instantly share code, notes, and snippets.

@tangzero
Last active December 28, 2015 17:09
Show Gist options
  • Save tangzero/7534039 to your computer and use it in GitHub Desktop.
Save tangzero/7534039 to your computer and use it in GitHub Desktop.
Gideros Class-Commons interface. see https://github.com/bartbes/Class-Commons
-- 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