entityx
entityx copied to clipboard
more efficient way of looping trough a bunch of classes?
my game uses a lot of classes, and every time I add a new class type I have to add
for (Entity entity : ex.entities.entities_with_components(ClassName)) to be able to update and draw it, this is crowding up my update function, is there a more efficient way of doing this?
You would typically have multiple systems, each doing distinct jobs, so it's a bit surprising that you have a single update function. The included example illustrates this approach, and it's how EntityX is designed to work.