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
What should happen when an entity is added twice? The current behaviour isn't too pretty: the entity is added to two slots in the array. In addition to this, the current operation delay mechanism leads to bad behavior when adding/removing entities inside of listeners or when an EntitySystem is executing. (See #161 for details.) I created two test cases for the behaviour when adding an entity twice:
Also worth noting is that it is perfectly allowed to do something evil such as nesting Engine updates; this should throw an exception rather than silently allowing it.
The text was updated successfully, but these errors were encountered:
Checking whether the entity is registered with an engine should be easy enough because the entityId is only set when that's the case.
Do we wanna throw when we try to add an entity that's registered with an engine already?
We can also throw when trying to do nesting engine updates.
We could very well say that adding an entity twice is undefined behavior and be done with it. However, I like trying to make Ashley hard to break, so we should probably cater for this problem.
What should happen when an entity is added twice? The current behaviour isn't too pretty: the entity is added to two slots in the array. In addition to this, the current operation delay mechanism leads to bad behavior when adding/removing entities inside of listeners or when an
EntitySystem
is executing. (See #161 for details.) I created two test cases for the behaviour when adding an entity twice:Also worth noting is that it is perfectly allowed to do something evil such as nesting
Engine
updates; this should throw an exception rather than silently allowing it.The text was updated successfully, but these errors were encountered: