Skip to main content

steel_core/entity/
selector.rs

1//! Entity selection predicates shared by queries, after vanilla `EntitySelector`.
2
3use super::Entity;
4
5pub(crate) struct EntitySelector;
6
7impl EntitySelector {
8    // TODO: apply vanilla team collision rules once teams are implemented
9    pub(crate) fn pushable_by(pusher: &dyn Entity) -> impl Fn(&dyn Entity) -> bool {
10        let pusher_id = pusher.id();
11
12        move |entity| entity.id() != pusher_id && !entity.is_spectator() && entity.is_pushable()
13    }
14}