Add support for "not tag_value" filter
- Lenguaje dominante
- Rust
- Estrellas
- 1.7k
- Forks
- 140
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Currently, `!tag::()` can be used for filtering entities without the `Static ` tag. However, this does not seem to be evenly supported for `!tag_value`.
For instance, this snippet compiles but the assertion is not fulfilled:
```rust
use legion::prelude::*;
#[derive(Clone, Copy, Debug, PartialEq)]
struct Position {
x: f32,
y: f32,
}
#[derive(Clone, Copy, Debug, PartialEq)]
struct Model(usize);
fn main() {
let mut world = Universe::new().create_world();
world.insert((Model(1),), vec![(Position { x: 0.0, y: 0.0 },)]);
world.insert((Model(2),), vec![(Position { x: 1.0, y: 1.0 },)]);
world.insert((Model(3),), vec![(Position { x: 2.0, y: 2.0 },)]);
let not_model_1 = !tag_value(&Model(1));
// ^ here
let count = Read::::query()
.filter(not_model_1)
.iter(&world)
.count();
assert_eq!(count, 2) // <= count is 0
}
```
Is this an intended behavior ?
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.