Created
June 19, 2020 07:30
-
-
Save BoxyUwU/2acae16fc8d555d1f8fdd33daca76fa0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn delete_entites(mut all_storages: AllStoragesViewMut) { | |
let mut to_kill = vec![]; | |
all_storages.run(|healths: View<Health>,| { | |
for (id, (health)) in (&healths).iter().with_id() { | |
if health.0 < 0 { | |
to_kill.push(id); | |
} | |
} | |
}); | |
for id in to_kill.into_iter() { | |
all_storages.delete(id); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment