Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more efficient way of looping trough a bunch of classes? #237

Open
BBQGiraffe opened this issue Apr 13, 2020 · 1 comment
Open

more efficient way of looping trough a bunch of classes? #237

BBQGiraffe opened this issue Apr 13, 2020 · 1 comment

Comments

@BBQGiraffe
Copy link

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?

@alecthomas
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants