entityx icon indicating copy to clipboard operation
entityx copied to clipboard

more efficient way of looping trough a bunch of classes?

Open BBQGiraffe opened this issue 5 years ago • 1 comments

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?

BBQGiraffe avatar Apr 13 '20 03:04 BBQGiraffe

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.

alecthomas avatar Apr 13 '20 08:04 alecthomas