Skip to content

Commit

Permalink
add is_consumed getter (#444)
Browse files Browse the repository at this point in the history
Co-authored-by: Charles Bournhonesque <[email protected]>
  • Loading branch information
cBournhonesque and cbournhonesque-sc authored Jan 17, 2024
1 parent cda8d12 commit 4057a60
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/action_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,13 @@ impl<A: Actionlike> ActionState<A> {
}
}

/// Is this `action` currently consumed?
#[inline]
#[must_use]
pub fn consumed(&self, action: A) -> bool {
self.action_data[action.index()].consumed
}

/// Is this `action` currently pressed?
#[inline]
#[must_use]
Expand Down

0 comments on commit 4057a60

Please sign in to comment.