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

Allow deleting all entities with World::delete_all #257

Merged
merged 1 commit into from
Sep 10, 2017

Conversation

torkleyy
Copy link
Member

@torkleyy torkleyy commented Sep 10, 2017

cc @Rhuagh

@Rhuagh
Copy link
Member

Rhuagh commented Sep 10, 2017

Looks good. I would like a way to delete from only a subset of components also though. After a deathmatch is done I want to delete all data for that match but keep the ui in place etc.

@torkleyy
Copy link
Member Author

I guess you could do that e.g. like this:

let delete: Vec<_> = (&*entities, !&ui).join().map(|(e, _)| e).collect();
world.delete_entities(&delete);

@torkleyy
Copy link
Member Author

Or filter for specific components. I think the above code shows how flexible this is ;)

@Rhuagh
Copy link
Member

Rhuagh commented Sep 10, 2017 via email

@torkleyy
Copy link
Member Author

bors r+

bors bot added a commit that referenced this pull request Sep 10, 2017
257: Allow deleting all entities with `World::delete_all` r=torkleyy a=torkleyy

cc @Rhuagh
@bors
Copy link
Contributor

bors bot commented Sep 10, 2017

Build succeeded

@bors bors bot merged commit 30bbd39 into amethyst:master Sep 10, 2017
@torkleyy torkleyy deleted the delete branch September 10, 2017 09:42
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

Successfully merging this pull request may close these issues.

2 participants