mirror of
https://github.com/Keyslam-Group/Concord.git
synced 2025-08-30 08:58:30 -04:00
Moved some files
This commit is contained in:
parent
281bb53a5b
commit
6c98c259e4
10 changed files with 673 additions and 676 deletions
|
@ -1,46 +0,0 @@
|
||||||
local PATH = (...):gsub('%.init$', '')
|
|
||||||
|
|
||||||
local Type = require(PATH..".type")
|
|
||||||
|
|
||||||
local Concord = {}
|
|
||||||
|
|
||||||
--- Initializes the library with some optional settings
|
|
||||||
-- @param settings Table of settings: {
|
|
||||||
-- useEvents Flag to overwrite love.run and use events. Defaults to false
|
|
||||||
-- }
|
|
||||||
-- @return Concord
|
|
||||||
function Concord.init(settings)
|
|
||||||
Concord.entity = require(PATH..".entity")
|
|
||||||
Concord.component = require(PATH..".component")
|
|
||||||
Concord.system = require(PATH..".system")
|
|
||||||
Concord.instance = require(PATH..".instance")
|
|
||||||
|
|
||||||
if settings and settings.useEvents then
|
|
||||||
Concord.instances = {}
|
|
||||||
|
|
||||||
Concord.addInstance = function(instance)
|
|
||||||
if not Type.isInstance(instance) then
|
|
||||||
error("bad argument #1 to 'Concord.addInstance' (Instance expected, got "..type(instance)..")", 2)
|
|
||||||
end
|
|
||||||
|
|
||||||
table.insert(Concord.instances, instance)
|
|
||||||
end
|
|
||||||
|
|
||||||
Concord.removeInstance = function(instance)
|
|
||||||
if not Type.isInstance(instance) then
|
|
||||||
error("bad argument #1 to 'Concord.addInstance' (Instance expected, got "..type(instance)..")", 2)
|
|
||||||
end
|
|
||||||
|
|
||||||
for i, instance in ipairs(Concord.instances) do
|
|
||||||
table.remove(Concord.instances, i)
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
love.run = require(PATH..".run")
|
|
||||||
end
|
|
||||||
|
|
||||||
return Concord
|
|
||||||
end
|
|
||||||
|
|
||||||
return Concord
|
|
45
init.lua
45
init.lua
|
@ -1,3 +1,46 @@
|
||||||
local PATH = (...):gsub('%.init$', '')
|
local PATH = (...):gsub('%.init$', '')
|
||||||
|
|
||||||
return require(PATH..".concord")
|
local Type = require(PATH..".type")
|
||||||
|
|
||||||
|
local Concord = {}
|
||||||
|
|
||||||
|
--- Initializes the library with some optional settings
|
||||||
|
-- @param settings Table of settings: {
|
||||||
|
-- useEvents Flag to overwrite love.run and use events. Defaults to false
|
||||||
|
-- }
|
||||||
|
-- @return Concord
|
||||||
|
function Concord.init(settings)
|
||||||
|
Concord.entity = require(PATH..".entity")
|
||||||
|
Concord.component = require(PATH..".component")
|
||||||
|
Concord.system = require(PATH..".system")
|
||||||
|
Concord.instance = require(PATH..".instance")
|
||||||
|
|
||||||
|
if settings and settings.useEvents then
|
||||||
|
Concord.instances = {}
|
||||||
|
|
||||||
|
Concord.addInstance = function(instance)
|
||||||
|
if not Type.isInstance(instance) then
|
||||||
|
error("bad argument #1 to 'Concord.addInstance' (Instance expected, got "..type(instance)..")", 2)
|
||||||
|
end
|
||||||
|
|
||||||
|
table.insert(Concord.instances, instance)
|
||||||
|
end
|
||||||
|
|
||||||
|
Concord.removeInstance = function(instance)
|
||||||
|
if not Type.isInstance(instance) then
|
||||||
|
error("bad argument #1 to 'Concord.addInstance' (Instance expected, got "..type(instance)..")", 2)
|
||||||
|
end
|
||||||
|
|
||||||
|
for i, instance in ipairs(Concord.instances) do
|
||||||
|
table.remove(Concord.instances, i)
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
love.run = require(PATH..".run")
|
||||||
|
end
|
||||||
|
|
||||||
|
return Concord
|
||||||
|
end
|
||||||
|
|
||||||
|
return Concord
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue