removeEntity method
Mark an entity for removal.
It will be fully removed in the next execute cycle.
Implementation
void removeEntity(Entity entity) {
if (!_entities.contains(entity) || _entitiesToRemove.contains(entity)) {
return;
}
entity.alive = false;
_entitiesToRemove.add(entity);
}