From 6ddb28ffbce89f8afe9639fa9d8a3cf03818aa53 Mon Sep 17 00:00:00 2001 From: Justin van der Leij Date: Mon, 26 Nov 2018 12:37:28 +0100 Subject: [PATCH] Small fixes --- LICENSE | 40 ++++++++++++------------ README.md | 78 +++++++++++++++++++++++----------------------- lib/assemblage.lua | 6 ++-- lib/component.lua | 4 ++- lib/entity.lua | 4 ++- lib/init.lua | 8 +++-- lib/instance.lua | 4 ++- lib/list.lua | 4 ++- lib/pool.lua | 4 ++- lib/system.lua | 4 ++- 10 files changed, 85 insertions(+), 71 deletions(-) diff --git a/LICENSE b/LICENSE index e3ce12d..8771a88 100644 --- a/LICENSE +++ b/LICENSE @@ -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. \ No newline at end of file diff --git a/README.md b/README.md index d2187ef..32f0383 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/lib/assemblage.lua b/lib/assemblage.lua index 67a1428..79b3cbb 100644 --- a/lib/assemblage.lua +++ b/lib/assemblage.lua @@ -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, }) diff --git a/lib/component.lua b/lib/component.lua index 5696968..63cb1fb 100644 --- a/lib/component.lua +++ b/lib/component.lua @@ -33,5 +33,7 @@ function Component:__initialize(...) end return setmetatable(Component, { - __call = function(_, ...) return Component.new(...) end, + __call = function(_, ...) + return Component.new(...) + end, }) diff --git a/lib/entity.lua b/lib/entity.lua index 441b9df..9cabe33 100644 --- a/lib/entity.lua +++ b/lib/entity.lua @@ -136,5 +136,7 @@ function Entity:has(component) end return setmetatable(Entity, { - __call = function(_, ...) return Entity.new(...) end, + __call = function(_, ...) + return Entity.new(...) + end, }) diff --git a/lib/init.lua b/lib/init.lua index 81887fb..61eb5e8 100644 --- a/lib/init.lua +++ b/lib/init.lua @@ -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 diff --git a/lib/instance.lua b/lib/instance.lua index fa59c35..571bfa4 100644 --- a/lib/instance.lua +++ b/lib/instance.lua @@ -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, }) diff --git a/lib/list.lua b/lib/list.lua index a5698c9..a79d20e 100644 --- a/lib/list.lua +++ b/lib/list.lua @@ -77,5 +77,7 @@ function List:has(obj) end return setmetatable(List, { - __call = function() return List.new() end, + __call = function() + return List.new() + end, }) diff --git a/lib/pool.lua b/lib/pool.lua index e7e949c..779efd9 100644 --- a/lib/pool.lua +++ b/lib/pool.lua @@ -46,5 +46,7 @@ end return setmetatable(Pool, { __index = List, - __call = function(_, ...) return Pool.new(...) end, + __call = function(_, ...) + return Pool.new(...) + end, }) diff --git a/lib/system.lua b/lib/system.lua index a42f79b..4572aa6 100644 --- a/lib/system.lua +++ b/lib/system.lua @@ -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, })