Releases: DickerDackel/tinyecs
v0.3.5
v0.3.4
v0.3.4
- Bugfix: Empty archetype was created with full component list instead of empty.
- Bugfix: Don't nuke the entity when calling create_entity on an existing eid.
- Docs: Changed docstrings to reST
- Docs: Far more complete
v0.3.3
v0.3.3
- Sphinx docs
- Lots of docstring cleanups and enhancements
- experimental stubs removed, type hints are now embedded
- BREAKING CHANGE - oidx must be a set, since an object can be registered with multiple entities
- various minor cleanups and enhancements
v0.3.2
v0.3.2
- Better defaults
- Removed leftover code from older versions
- Fixes outdated imports
- Fix has_properties parameter
v0.3.1
v0.3.1
- New function
purge_by_property - linter fixes, slight optimizations
v0.3.0
v0.3.0
- Properties!
From the new section in README.md:
Properties
Properties are a new addition to tinyecs. Until now, the only way to mark an
entity to be of a specific type, or have a special feature, was to add a flag
component, e.g.
ecs.add_component(eid, 'is-drawable', True)while not pretty, this does the job, but has the problem that you now need
different systems for times when you do want to filter, and if you don't want
to, since that flag component is added to the arguments of the system.
To solve this, properties (as inspired by Lisp) have been added. These are
"flags" that live outside the component registry. They will not be handed
over to the system when used in run_system.
You can add, remove, and check for them like this:
ecs.set_property(eid, 'is-drawable')
ecs.has_property(eid, 'is-drawable') # --> True
ecs.remove_property(eid, 'is-drawable')The tinyecs functions that return multiple entities and components now support
filtering by these properties.
ecs.run_system(dt, 'position', 'sprite', has_properties{'is-drawable'})
ecs.has(eid, has_properties={'is-sprite'})
result = ecs.eids_by_cids('position', 'sprite',
has_properties={'is-drawable'})
result = ecs.comps_of_archetype('position', 'sprite',
has_properties={'is-drawable', ...})This way, e.g. sprites can now be layered by filtering for the different
types:
ecs.run_system(0, render_sprites, 'position', 'sprite', has_properties={'is-enemy'))
ecs.run_system(0, render_sprites, 'position', 'sprite', has_properties={'bullet'))
ecs.run_system(0, render_sprites, 'position', 'sprite', has_properties={'fx'))
ecs.run_system(0, render_sprites, 'position', 'sprite', has_properties={'hud'))Finally, properties can be searched directly, e.g. to prune dead entities:
for eid in ecs.eid_by_property('is-dead'):
ecs.remove_entity(eid)v0.2.10
v0.2.10
- Fixed docs
v0.2.9
v0.2.9
- Follow API change in pgcooldown
- Simplified archetype creation
- global was bullshit there
- Formatting fixes (hopefully)
v0.2.8
v0.2.8
- Tutorial!
v0.2.7
v0.2.7
- Archetypes!
- More test objects, better readable output
- FPS in titlebar and release boxes on mouseclick
- Just standardized the FPS display in the titlebar