v0.8.1
This is a critical fix addressing wrongly sorted internal Query data structures.
Additionally, it changes how data is matched. User-created queries will no longer match special core components.
A new cleanup rule was added that tells the framework a certain entity is not allowed to be deleted. They can be used by adding a relationship pair (OnDelete, Error) and/or (OnDeleteTarget, Error) to an entity.
ecs::World w;
ecs::Entity rabbit = w.add();
ecs::Entity eats = w.add();
ecs::Entity carrot = w.add();
w.add(rabbit, ecs::Pair(eats, carrot));
w.add(carrot, ecs::Pair(OnDelete, Error));
w.del(carrot); // This asserts and reports errors!
w.add(carrot, ecs::Pair(OnDeleteTarget, Error));
w.del(rabbit, ecs::Pair(eats, carrot)); // This asserts and reports errors!
Release notes
Fixed:
- Wrong query items ordering 7d99342
Changed:
- Changed: Core components can't be deleted 04475c1
- Changed: Special core components won't be matched by user queries 04475c1
Added:
- (OnDelete[Target], Error) to prevent entities from getting deleted 04475c1
Full Changelog: v0.8.0...v0.8.1