Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Perform world.refresh() automatically and provide API for efficient mass changes #60
So right now if you don't call refresh() on the world after creating an entity (or presumably after changing one entiy's active status?) the new entity's components aren't processed by the systems.
Furthermore, if you happen to call refresh() without any new entities or changing their active status, then anax effectively stops processing all (!) entities. Meaning the "activated" entities list is empty. At least that second part should - at a minimum - raise an error.
But generally I don't really see the point in having to manually refresh the world except for mass changes / creation of entities. In that light I would prefer a solution that calls refresh automatically by default, and for bulk changes offer a way to do so.
Also: it took me an hour debugging anax to figure out that the world needs refreshing and that this was causing my component systems not updating. I'm sure there'll be others running into this as well.
A common pattern is to temporarily disable automatic updates of the world, only to refresh the world at the end, for instance:
This is a good idea. Not sure about that huge name though. However, this may cause more issues with #61, but if I implemented my idea I mentioned, I think it would be fine.
I thought I fixed this bug, but apparently not. Maybe I'm confusing this for another bug.