diff --git a/jojo.lua b/jojo.lua index b0becf9..9486495 100644 --- a/jojo.lua +++ b/jojo.lua @@ -1,15 +1,17 @@ local jojo = { - _VERSION = "0.0.2", - _URL = "https://github.com/bakpakin/Jojo" + _VERSION = "0.0.3", + _URL = "https://github.com/bakpakin/Jojo", + _DESCRIPTION = "Entity Component System for lua." } -- Simplified class implementation with no inheritance or polymorphism. local setmetatable = setmetatable -local function class() +local function class(name) local c = {} local mt = {} setmetatable(c, mt) c.__index = c + c.name = name function mt.__call(_, ...) local newobj = {} setmetatable(newobj, c) @@ -21,9 +23,9 @@ local function class() return c end -local World = class() -local Aspect = class() -local System = class() +local World = class("World") +local Aspect = class("Aspect") +local System = class("System") jojo.World = World jojo.Aspect = Aspect @@ -168,8 +170,6 @@ end ----- System ----- -System.nextID = 0 - -- System(preupdate, update, [aspect, addCallback, removeCallback]) -- Creates a new System with the given aspect and update callback. The update @@ -186,15 +186,10 @@ function System:init(preupdate, update, aspect, add, remove) self.active = true self.add = add self.remove = remove - local id = System.nextID - self.id = id - System.nextID = id + 1 end function System:__tostring() - return "JojoSystem