I found this “issue” and i am not sure if its the expected behaviour or not.
Following scenario:
EntitySystem is running, and after a while i am creating a new EntitySet trough EntityData.getEntities(…).
What i would have expected is that all entities with the components specified are in the Set itself and in the addedEntities Set.
Turns out that the addedEntities Set is only get filled with entities meeting the requirements after the EntityData was created.
Not sure if i made clear myself. Its not a big issue since it is easy to workaround, just wanted to make sure if its expected or not.
Can’t understand this. The EntityData is surely created if the ES is running.
The entity sets’ sublists (changed, added and removed) are updated when you call the EntitySet.applyChanges() method. Typically, an entity is considered “added” if it was not in the set on last call, and is now.
I know that the set is already filled after creation, i just would have expected that the addedEntities set is also filled. Containing the same entities as the set itself.
Yeah, there was a reason I did it this way… but I don’t remember what it was. It must have been obvious at the time or I’d have written it down. Past me was wrong about that part, though.
EntityContainer seems interesting. It’s a kind of entity observer. Do you plan to create a custom control to bind entities to JME spatials as an exemple?
Yeah, creating models and attaching them to the scene is also the only usecase i have noticed this behaviour. I have a EntityObjectMapper with nearly the same functionallity as your Container.