Commit graph

179 commits

Author SHA1 Message Date
Jesse Viikari
91382e004c Add resources to world
- setResource(name, resource) to set a resource
- getResource(name) to retrieve it
2021-11-26 16:16:53 +02:00
Pablo Mayobre
2621d7a9ea
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
2021-11-25 17:12:05 -03:00
Pablo Mayobre
e4713fd2d8
Add ability to clone components
Fixes #51
2021-11-03 11:43:19 -03:00
Pablo Mayobre
fa7792e083
Automate Docs building with Github Actions
Author: Justin van der Leij <justinvanderleij@gmail.com>

Co-authored-by: : Justin van der Leij <justinvanderleij@gmail.com>
2021-11-03 10:39:05 -03:00
Pablo Ariel Mayobre
64513ca16b
Merge pull request #53 from flamendless/experimental
Fixed bug with serialization/deserialization
2021-11-03 00:40:11 -03:00
flamendless
345b8cafe0 Fixed bug with serialization/deserialization 2021-11-03 10:44:13 +08:00
Pablo Ariel Mayobre
5229358eb6
Merge pull request #50 from flamendless/experimental
Added optional table for output for entity:getComponents
2021-09-04 09:44:32 -03:00
flamendless
c7c3a512af Added optional table for output for entity:getComponents 2021-09-04 20:45:09 +08:00
Pablo Ariel Mayobre
d6bd0de564
Ignore non-lua files in Utils.loadNamespace
Fixes #48
2021-08-09 22:09:41 -03:00
Pablo Ariel Mayobre
6379092642
Fix require indentation 2021-07-03 18:11:17 -03:00
Pablo Ariel Mayobre
58a63861a3
Merge pull request #47 from flamendless/experimental
Fixed errors on World:deserialize
2021-07-03 18:10:30 -03:00
flamendless
63add66633 Fixed errors on World:deserialize 2021-07-03 15:12:58 +08:00
Pablo Ariel Mayobre
2e5e965ae9 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.
2021-07-03 01:09:09 -03:00
Pablo Ariel Mayobre
3911e212a4
Add World:query
This method allows you to query the World in order to find a set of Entities that matches a specific Filter.
2021-05-05 12:49:12 -03:00
Pablo Ariel Mayobre
f78811337a
World:newEntity
A shortcut for Concord.entity(World)
2021-05-05 12:49:12 -03:00
Pablo Ariel Mayobre
f9f475ce48
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.
2021-05-05 12:47:39 -03:00
Pablo Ariel Mayobre
0b1e26624a
Error handling overhaul 2021-05-05 12:46:12 -03:00
Pablo Ariel Mayobre
8d1237f574
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
2021-05-05 12:44:59 -03:00
Pablo Ariel Mayobre
6f08cfe10a
Fix utils.loadNamespace when passed a table 2021-05-05 12:44:47 -03:00
Pablo Ariel Mayobre
6392616823
Add Component:removed() callback
Fixes #37

I also added a reference to the Entity inside the Component which will help with #38
2021-01-09 19:26:21 -03:00
Pablo Ariel Mayobre
b6e4cd6fe9
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.
2021-01-09 19:26:21 -03:00
Pablo Ariel Mayobre
8f57cadce9
Add Component Negation
Fixes #32
2021-01-09 19:23:34 -03:00
Pablo Ariel Mayobre
dd155588a0
List.sort
Fixes #33
2021-01-09 19:22:39 -03: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
Justin van der Leij
b906e2a910 Update docs 2020-03-16 10:35:55 +01:00
Pablo Ariel Mayobre
f640258852
Fix component:serialize can return nil 2020-03-15 01:04:44 -03:00
Pablo Ariel Mayobre
78dc7ee937
Fixed some error messages 2020-03-15 00:20:06 -03:00
Pablo Ariel Mayobre
d8621e4070
Fix serialization function to guard internal values 2020-03-14 19:09:23 -03:00
Pablo Ariel Mayobre
079c1d0e18
Utils.shallowCopy as a default serializer/deserializer for Components 2020-03-14 18:45:15 -03:00
Pablo Ariel Mayobre
9ae805aa43
Fixed: Pool:evaluate should bypass Pool:add filter check 2020-03-14 14:56:33 -03:00
Pablo Ariel Mayobre
16e111176e
Added Utils.loadNamespace
Deleted the previous Concord.loadComponents/Systems/Worlds
2020-03-14 14:55:11 -03:00
Pablo Ariel Mayobre
c640641b09
CONCORD IS DEAD
Long live Concord!!
2020-03-14 07:45:25 -03:00
Tjakka5
5dffe04b72 Fix flushing failing 2020-01-18 19:44:09 +01:00
Tjakka5
5252b0901b Merge branch 'master' of https://github.com/Tjakka5/Concord 2020-01-18 19:27:07 +01:00
Tjakka5
275d54726d Allow emits within emits 2020-01-18 19:26:38 +01:00
Justin van der Leij
be4a5d9ec7
Merge pull request #25 from jackamo/fix/quick-readme-fixes
README: Fix 'Quick Example' to be runnable
2020-01-09 10:58:02 +01:00
Jack Robinson
91f5799e50 README: Fix 'Quick Example' to be runnable 2020-01-09 22:12:39 +13:00
speakk
532151d901
Fix a typo in README. 2020-01-06 02:56:18 +02:00
Justin van der Leij
2cd738a135
Merge pull request #23 from tesselode/ldoc-improvements
make the docs a little nicer
2020-01-04 16:40:23 +01:00
Justin van der Leij
c39151faa7
Merge pull request #22 from tesselode/patch-1
fix typos in readme
2020-01-04 16:40:12 +01:00