Small fixes

This commit is contained in:
Justin van der Leij 2018-11-26 12:37:28 +01:00
parent f7a394f057
commit 6ddb28ffbc
10 changed files with 85 additions and 71 deletions

View file

@ -10,8 +10,6 @@ function Assemblage.new(assemble)
__isAssemblage = true,
}, Assemblage)
Assemblage.__mt = {__index = assemblage}
return assemblage
end
@ -22,5 +20,7 @@ function Assemblage:assemble(e, ...)
end
return setmetatable(Assemblage, {
__call = function(_, ...) return Assemblage.new(...) end,
__call = function(_, ...)
return Assemblage.new(...)
end,
})

View file

@ -33,5 +33,7 @@ function Component:__initialize(...)
end
return setmetatable(Component, {
__call = function(_, ...) return Component.new(...) end,
__call = function(_, ...)
return Component.new(...)
end,
})

View file

@ -136,5 +136,7 @@ function Entity:has(component)
end
return setmetatable(Entity, {
__call = function(_, ...) return Entity.new(...) end,
__call = function(_, ...)
return Entity.new(...)
end,
})

View file

@ -61,11 +61,13 @@ function Concord.init(settings)
error("bad argument #1 to 'Concord.addInstance' (Instance expected, got "..type(instance)..")", 2)
end
for i, instance in ipairs(Concord.instances) do
for i, _instance in ipairs(Concord.instances) do
if (instance == _instance) then
table.remove(Concord.instances, i)
break
end
end
end
love.run = require(PATH..".run")
end

View file

@ -282,5 +282,7 @@ function Instance:onEntityRemoved(e) -- luacheck: ignore
end
return setmetatable(Instance, {
__call = function(_, ...) return Instance.new(...) end,
__call = function(_, ...)
return Instance.new(...)
end,
})

View file

@ -77,5 +77,7 @@ function List:has(obj)
end
return setmetatable(List, {
__call = function() return List.new() end,
__call = function()
return List.new()
end,
})

View file

@ -46,5 +46,7 @@ end
return setmetatable(Pool, {
__index = List,
__call = function(_, ...) return Pool.new(...) end,
__call = function(_, ...)
return Pool.new(...)
end,
})

View file

@ -156,5 +156,7 @@ function System:disabledCallback(callbackName) -- luacheck: ignore
end
return setmetatable(System, {
__call = function(_, ...) return System.new(...) end,
__call = function(_, ...)
return System.new(...)
end,
})