Commit graph

195 commits

Author SHA1 Message Date
Jesse Viikari
bbcb49b6f9
Add resources to world
- setResource(name, resource) to set a resource
- getResource(name) to retrieve it
2023-02-14 18:18:43 -03:00
Pablo Mayobre
cb34513d21
Usability improvements
- Now entity.key() is the same as entity.key.value
- Entity:serialize only serializes component given correctly
- Any other value inside the Entity is ignored
- Disable some diagnostics used in Lua language server by sumneko
2023-02-14 18:18:43 -03:00
Pablo Mayobre
88b342f0ab
Add ability to clone components
Fixes #51
2023-02-14 18:18:42 -03:00
flamendless
b47fe315c7
Fixed bug with serialization/deserialization 2023-02-14 18:18:42 -03:00
flamendless
e8ccf0f295
Added optional table for output for entity:getComponents 2023-02-14 18:18:42 -03:00
Pablo Ariel Mayobre
7b1df11cfb
Ignore non-lua files in Utils.loadNamespace
Fixes #48
2023-02-14 18:18:41 -03:00
Pablo Ariel Mayobre
95c6a5e085
Fix require indentation 2023-02-14 18:14:25 -03:00
flamendless
748b207252
Fixed errors on World:deserialize 2023-02-14 18:14:25 -03:00
Pablo Ariel Mayobre
f795fee2c5
Entity's Keys
You can now give the 'key' component to Entities.

A key will be generated automatically and stored in Entity.key.value.

You can then use this key to fetch the Entity from the World with World:getEntityByKey(key)

The keys are generated with a generator function that can be overriden.
2023-02-14 18:14:25 -03:00
Pablo Ariel Mayobre
772dd03b78
Add World:query
This method allows you to query the World in order to find a set of Entities that matches a specific Filter.
2023-02-14 18:14:24 -03:00
Pablo Ariel Mayobre
238aaeca12
World:newEntity
A shortcut for Concord.entity(World)
2023-02-14 18:14:24 -03:00
Pablo Ariel Mayobre
afc5643755
Serializable component
You can remove the component to tell Concord an Entity shouldn't be serialized.

It's given automatically on Entity creation, but this can be disabled by changing Entity.SERIALIZE_BY_DEFAULT to false.
2023-02-14 18:14:24 -03:00
Pablo Ariel Mayobre
c5c056f566
Error handling overhaul 2023-02-14 18:14:24 -03:00
Pablo Ariel Mayobre
d854e93e70
Replaced Pools with Filters
Filters allow for a Pool constructor (defaults to Lists) that can be used to define Custom Pools.

The constructor is a function that takes the Filter Definition and returns a Custom Pool with these functions:

:add(e) - Add the Entity to the pool
:remove(e) - Remove the Entity from the pool
:has(e) boolean - Checks if the Entity exists in the pool
:clear() - Clears the Pool from Entities

Fixes #40
2023-02-14 18:14:23 -03:00
Pablo Ariel Mayobre
eec6f4f29e
Fix utils.loadNamespace when passed a table 2023-02-14 18:14:23 -03:00
Pablo Ariel Mayobre
0dfc922e9a
Add Component:removed() callback
Fixes #37

I also added a reference to the Entity inside the Component which will help with #38
2023-02-14 18:14:23 -03:00
Pablo Ariel Mayobre
651472413b
Removed deprecated functionality
Removed hasName/getName on Systems and Worlds.

Removed Entity.__components since it had a duplicate version of the components stored in the Entity itself.
2023-02-14 18:14:23 -03:00
Pablo Ariel Mayobre
ea59529ddc
Add Component Negation
Fixes #32
2023-02-14 18:14:22 -03:00
Pablo Ariel Mayobre
1c99d534c2
List.sort
Fixes #33
2023-02-14 18:14:08 -03:00
Justin van der Leij
a45d89457b
Merge pull request #66 from wolfboyft/master
Fix bug where loading namespaces using folder/init.lua entries would only work if "folder" was 3 characters
2022-10-17 21:53:30 +02:00
Tachytaenius
940870318d
Fix bug where loading namespaces using folder/init.lua entries would only work if "folder" was 3 characters 2022-10-17 20:17:54 +01:00
Justin van der Leij
821b36c903
Merge pull request #46 from john-cheesman/correct-readme-code
Correct syntax in Systems example code
2022-10-17 15:12:18 +02:00
Justin van der Leij
7a4bfaf33c
Merge pull request #59 from josh-perry/fix-readme-docs-link
Fixed docs link in README
2022-06-01 17:51:12 +02:00
Josh Perry
2acb1458f2 Fixed docs link in README 2022-05-31 20:20:54 +01:00
Justin van der Leij
edc1d2fdbc Fix documentation page building workflow 13 2021-11-02 20:10:14 +01:00
Justin van der Leij
4313dc7856 Fix documentation page building workflow 12 2021-11-02 17:27:18 +01:00
Justin van der Leij
9c22986501 Fix documentation page building workflow 11 2021-11-02 17:23:53 +01:00
Justin van der Leij
73177f4048 Fix documentation page building workflow 10 2021-11-02 17:21:51 +01:00
Justin van der Leij
6ce714ce14 Fix documentation page building workflow 9 2021-11-02 17:21:22 +01:00
Justin van der Leij
e141a6183b Fix documentation page building workflow 8 2021-11-02 17:18:57 +01:00
Justin van der Leij
6329e09138 Fix documentation page building workflow 7 2021-11-02 17:16:51 +01:00
Justin van der Leij
cdf425d301 Fix documentation page building workflow 6 2021-11-02 17:08:25 +01:00
Justin van der Leij
c7625ad376 Fix documentation page building workflow 5 2021-11-02 17:02:38 +01:00
Justin van der Leij
65aae3c2ba Fix documentation page building workflow 4 2021-11-02 16:57:08 +01:00
Justin van der Leij
297b30aa50 Fix documentation page building workflow 3 2021-11-02 16:55:04 +01:00
Justin van der Leij
9aaff0fbcc Fix documentation page building workflow 2 2021-11-02 16:37:30 +01:00
Justin van der Leij
b701493a27 Fix documentation page building workflow 2021-11-02 16:32:24 +01:00
Justin van der Leij
b53f950e3e Add documentation page building workflow 2021-11-02 16:30:23 +01:00
John Cheesman
fd558dd3fe
Correct syntax in Systems example code 2021-05-05 18:32:04 +01:00
Pablo Ariel Mayobre
eb82c3c580
Update version
This will be version 3.0 of Concord
2021-01-09 19:20:03 -03:00
Pablo Ariel Mayobre
1325c4b445
Merge pull request #31 from DanielPower/master
Fix error in readme
2021-01-08 03:49:32 -03:00
Pablo Ariel Mayobre
d5c551046b
Merge pull request #24 from speakk/patch-1
Fix a typo in README.
2021-01-08 03:49:15 -03:00
Daniel Power
2196a41e71 Fix error in readme 2020-11-15 23:44:15 -03:30
Justin van der Leij
dd072adbe9
Merge pull request #30 from josh-perry/master
Regenerated docs
2020-08-18 16:24:21 +02:00
Josh Perry
7979226c33 Regenerated docs 2020-08-18 15:20:56 +01:00
Justin van der Leij
0897b1e4f9
Merge pull request #29 from Tjakka5/dev
Dev
2020-08-18 11:27:37 +02:00
Tjakka5
3e9c596187 Fix mistakes in readme 2020-05-02 20:51:15 +02:00
Tjakka5
c95a1f2768 Update license 2020-05-02 20:44:58 +02:00
Tjakka5
d56821205d Make repo submodule friendly 2020-05-02 20:44:33 +02:00
Tjakka5
c889b15d44 Remove old examples 2020-05-02 20:42:26 +02:00