Skip to content

Commit

Permalink
Remove UntypedActionEvent
Browse files Browse the repository at this point in the history
No longer used.
  • Loading branch information
Shatur committed Nov 1, 2024
1 parent a2f092d commit e54641a
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions src/input_context/input_action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,37 +225,6 @@ impl<A: InputAction> Clone for ActionEvent<A> {

impl<A: InputAction> Copy for ActionEvent<A> {}

impl<A: InputAction> From<UntypedActionEvent> for ActionEvent<A> {
fn from(value: UntypedActionEvent) -> Self {
Self {
marker: PhantomData,
kind: value.kind,
value: value.value,
state: value.state,
}
}
}

/// Represents an [`ActionEvent`] without its associated action type marker.
///
/// This can be used to store event data in a type-erased manner.
#[derive(Clone, Copy)]
pub struct UntypedActionEvent {
pub kind: ActionEventKind,
pub value: ActionValue,
pub state: ActionState,
}

impl<A: InputAction> From<ActionEvent<A>> for UntypedActionEvent {
fn from(value: ActionEvent<A>) -> Self {
Self {
kind: value.kind,
value: value.value,
state: value.state,
}
}
}

bitflags! {
/// [`ActionEventKind`]s triggered for an action.
#[derive(Default, Clone, Copy, Debug, PartialEq, Eq)]
Expand Down

0 comments on commit e54641a

Please sign in to comment.