generated from Leafwing-Studios/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 144
Closed
Labels
controversialRequires a heightened standard of reviewRequires a heightened standard of reviewenhancementNew feature or requestNew feature or request
Description
Many actions are only meaningful in association with non-enumerable data.
A very useful pattern here is to store information in the enum variant, and then update that appropriately.
We want to be able to express:
#[derive(Actionlike, Clone)]
enum ArpgAction {
Movement(Direction),
Ability1,
Ability2,
Ability3,
Ability4,
Ultimate,
}
input_map.insert(ArpgAction::Movement(Direction::NORTH), KeyCode::Up);
let ArpgAction::Movement(direction) = action_state.get_value::<ArpgAction::Movement>();
Unfortunately, a reasonable API for the last step seems to be completely blocked on rust-lang/rfcs#2593, which, unsurprisingly, is postponed indefinitely 🙃
Metadata
Metadata
Assignees
Labels
controversialRequires a heightened standard of reviewRequires a heightened standard of reviewenhancementNew feature or requestNew feature or request