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

40
LICENSE
View file

@ -1,21 +1,21 @@
MIT License
Copyright (c) 2018 Justin van der Leij
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
MIT License
Copyright (c) 2018 Justin van der Leij
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -1,39 +1,39 @@
# Concord
Concord is a feature complete ECS.
It's main focus is on speed and usage. You should be able to quickly write code that performs well.
Documentation for Concord can be found in the [Wiki tab](https://github.com/Tjakka5/Concord/wiki).
Auto generated docs for Concord can be found in the [Github page](https://tjakka5.github.io/Concord/). These are still work in progress and might be incomplete though.
## Installation
Download the repository and drop it in your project, then simply require it as:
```lua
local Concord = require(PathToConcord).init()
You will only need to call .init once when you first require it.
```
## Modules
Below is a list of modules.
More information about what each done can be found in the Wiki
```lua
local Concord = require("concord")
local Entity = require("concord.entity")
local Component = require("concord.component")
local System = require("concord.system")
local Instance = require("concord.instance")
```
## Contributors
```
Positive07: Constant support and a good rubberduck
Brbl: Early testing and issue reporting
Josh: Squashed a few bugs and docs
Erasio: Took inspiration from HooECS. Also introduced me to ECS.
```
## Licence
MIT Licensed - Copyright Justin van der Leij (Tjakka5)
# Concord
Concord is a feature complete ECS.
It's main focus is on speed and usage. You should be able to quickly write code that performs well.
Documentation for Concord can be found in the [Wiki tab](https://github.com/Tjakka5/Concord/wiki).
Auto generated docs for Concord can be found in the [Github page](https://tjakka5.github.io/Concord/). These are still work in progress and might be incomplete though.
## Installation
Download the repository and drop it in your project, then simply require it as:
```lua
local Concord = require(PathToConcord).init()
You will only need to call .init once when you first require it.
```
## Modules
Below is a list of modules.
More information about what each done can be found in the Wiki
```lua
local Concord = require("concord")
local Entity = require("concord.entity")
local Component = require("concord.component")
local System = require("concord.system")
local Instance = require("concord.instance")
```
## Contributors
```
Positive07: Constant support and a good rubberduck
Brbl: Early testing and issue reporting
Josh: Squashed a few bugs and docs
Erasio: Took inspiration from HooECS. Also introduced me to ECS.
```
## Licence
MIT Licensed - Copyright Justin van der Leij (Tjakka5)

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,9 +61,11 @@ 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
table.remove(Concord.instances, i)
break
for i, _instance in ipairs(Concord.instances) do
if (instance == _instance) then
table.remove(Concord.instances, i)
break
end
end
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,
})