bevyengine / bevyengine/bevy

Allow for querying a specific variant of an Enum+Component

Open
#17,050 3 comments 9 reactions 0 assignees View on GitHub
A-ECS C-Feature S-Needs-Design
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## What problem does this solve or what need does it fill?
Imagine I have a component which is an enum , like AbilityState

```
#[derive(Component)]
pub enum AbilityState {
Preparing,
Casting,
Complete
}

```

It would be very nice to have a way to query for ONLY the entities who have that component AND in which the component is set to a particular variant.

The way it is now, I have to query for all entities with that component and then match on the state which is fine but quite verbose and silly looking since i have 1 system per variant.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.