All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Clearing an entity with inherited tags no longer hangs.
EntityComponents.pop
now correctly returns defaults when the components are inherited instead of local.
- Fixed type of default parameter for
EntityComponents.get
.
- Queries are now truthy if they match any entity.
- Renamed
World
to the more standard nameRegistry
in multiple places.
World
is nowRegistry
WorldQuery
is nowBoundQuery
.world
attributes ofEntity
andBoundQuery
are now.registry
- Updated
EntityComponents.__ior__
type hints which were causing false positives.
- Added the
tcod.ecs.IsA
sentinel value. - Entities will automatically inherit components/tags/relations from entities they have an
IsA
relationship with. #15 - Entities can be used as prefabs, use
Entity.instantiate()
to make a new entities inheriting the base entities components/tags/relations.
tcod.ecs.query.Query
removed due to a refactor.abstract_component
decorator removed.
- Fix for
x in Entity.relation_tags_many
not checking the correct values.
- Added
WorldQuery.get_entities
for returning query results as a set.
- Removed an optimization which would check the equality of component values, since this would fail when comparing some types such as NumPy arrays.
- Removed unintentional iteration behavior from
World
. #8
- Relation component lookup tables were replacing previous entries instead of adding to them.
- Relation ellipsis lookup tables were discarding entities which still had a relevant relation.
tcod.ecs.typing.ComponentKey
is now stable.- Can now register a callback to be called on component changes.
- Fixed stale caches for relation components.
- Unpickled worlds had reversed relations from what were saved.
Entity.relation_components
now hasMutableMapping
functionality.- You can now set the value of
Entity.relation_components[component_key] = {target: component}
. - Added the
Entity.clear
method which effectively deletes an entity by removing its components/tags/relations. This does not delete relations targeting the cleared entity.
- Now supports giving a query to another relation query, allowing conditional and chained relation queries. #1
- The type returned by
World.Q
has been renamed fromtcod.ecs.Query
totcod.ecs.query.WorldQuery
. - Serialization format updated.
- Added a simple query cache. A query is automatically cached until any of the components/tags/relations it depends on have changed.
- Serialization format updated, older versions will not be able to unpickle this version.
- Reduced the size of the pickled World.
- Missing components in
Entity.components
now returns the missing key in the KeyError exception instead of the entity. - Backwards relations for querying were not cleared on relation deletions.
Entity.components
now supports the|=
assignment operator.
Entity.tags
now supports the|=
and-=
assignment operators.
- Warn if a string is passed directly as a tags parameter, which might cause unexpected behavior.
Entity.relation_tags
has been renamed toEntity.relation_tag
.
- Deprecated the renamed attribute
Entity.relation_tag
.
World.new_entity
can now take aMapping
as thecomponents
parameter.
- Implicit keys for components have been deprecated in all places.
- The names feature has been deprecated.
Entity.components.by_name_type
has been deprecated.
World.global_
has been deprecated sinceworld[None]
is simpler and less redundant.
Entity.components.by_name_type(name_type, component_type)
to iterate over named components with names of a specific type.
- Remap
World.global_
touid=None
.
- You can now use custom identifiers for entity objects.
You can access these from World instances with
entity = world[uid]
.
- Dropped support for unpickling v1.0 World objects.
- Allow
Entity
instances to be referenced weakly.
- Added missing typing marker.
- Corrected the type-hinting of
Entity.component.get
andEntity.component.setdefault
.
- World's now have a globally accessible entity accessed with
World.global_
.
- You can now quickly lookup the relation tags and relation component keys of an entity.
First stable release.