dmlary / morrow

Ruby ECS-based MUD server
MIT License
4 stars 1 forks source link

Entity destruction implementation #27

Closed dmlary closed 4 years ago

dmlary commented 4 years ago

We cannot safely destroy an entity as World.update is being run because EntityManager::Views may still have references to the entity and try to access other components. To work around this World.destroy_entity() needs to initiate a delated destroy of the entity.

This should work because the lifetime of the entity will be:

Only concerns is another system making use of ViewExemptComponent, but they'll just have to exclude DeletedComponent.

dmlary commented 4 years ago

added in #63