add class() for easy definition of classes
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
Decoration = {}
|
||||
Decoration.type = "Decoration"
|
||||
Decoration.supertype = Entity.type
|
||||
Decoration.display = Animation:new(animation.particle.simple)
|
||||
setmetatable(Decoration, Entity)
|
||||
Decoration = class(Entity, {
|
||||
type = "Decoration",
|
||||
supertype = Entity.type,
|
||||
display = Animation:new(animation.particle.simple),
|
||||
})
|
||||
|
||||
function Decoration:new(x,y,animation,light_data)
|
||||
local o = Entity:new(x,y)
|
||||
@@ -22,7 +22,6 @@ function Decoration:new(x,y,animation,light_data)
|
||||
o:id()
|
||||
|
||||
setmetatable(o, self)
|
||||
self.__index = self
|
||||
return o
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user