I want to delete all entities from world. And if a tag or a group is registered for the entity, I want to remove them too. Like there was no such entity at all. It is much like World.delete
function, but you should loop on all entities. I can't find a way. And can't believe the designers didn't prepare such functionality for clearing the world from entities. Do I miss something?
Artemis - how to delete all entities from world
682 views Asked by Narek At
1
There's no default way of deleting all entities from the World - typically this is done by disposing and recreating the world - but it can be easily achieved by adding a custom manager:
In recent versions of artemis-odb it's easier to use the AspectSubscriptionManager:
edit: The above code assumes artemis-odb; I'm not sure whether vanilla artemis' TagManager and GroupManager automatically removes entities upon deletion.