You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This should solve problems with object transport. Entities become untied of EntityManager.
When entity is added to EntityManager hierarchy and get access to ManagerList, we should send a Connected event to connected subtree. Optionally we can also pass managerList in this event. When subtree is disconnected, all children get Disconnected event. Presenter components use this events to create/remove renders.
(I realised that such code can't work, because all components of entity will get this events at same time. Thus I can't call Connected event on component creation.)
Also this code can be placed in Component base class and usual virtual connected()/disconnected()/init() methods could be called.
Finally, this approach can help us to simplify entity-component tree.
To provide necessary methods for entity manipulation, we can create common parent class for EntityManager and Entity.
About memory safety. We can create temporary entity for component in Component constructor. So we can use entity() method in component constructor without crashes. This temporary entity will be removed when component is added to another entity. If programmer added some components to temprorary entity they also will be removed.
The text was updated successfully, but these errors were encountered:
This should solve problems with object transport. Entities become untied of EntityManager.
When entity is added to EntityManager hierarchy and get access to ManagerList, we should send a Connected event to connected subtree. Optionally we can also pass managerList in this event. When subtree is disconnected, all children get Disconnected event. Presenter components use this events to create/remove renders.
(I realised that such code can't work, because all components of entity will get this events at same time. Thus I can't call Connected event on component creation.)
Also this code can be placed in Component base class and usual virtual connected()/disconnected()/init() methods could be called.
Finally, this approach can help us to simplify entity-component tree.
To provide necessary methods for entity manipulation, we can create common parent class for EntityManager and Entity.
About memory safety. We can create temporary entity for component in Component constructor. So we can use entity() method in component constructor without crashes. This temporary entity will be removed when component is added to another entity. If programmer added some components to temprorary entity they also will be removed.
The text was updated successfully, but these errors were encountered: