Skip to content

Commit

Permalink
Bevy Input Docs : lib.rs (#9468)
Browse files Browse the repository at this point in the history
# Objective

Complete the documentation of `bevy_input` (#3492).

This PR is part of a triptych of PRs :
- #9467
- #9469

## Solution

Add missing documentation on items in `lib.rs`.

---------

Co-authored-by: Pascal Hertleif <killercup@gmail.com>
  • Loading branch information
tguichaoua and killercup committed Aug 19, 2023
1 parent 0087556 commit b9ab17e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/bevy_input/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ use bevy_reflect::{ReflectDeserialize, ReflectSerialize};
#[derive(Default)]
pub struct InputPlugin;

/// Label for systems that update the input data.
#[derive(Debug, PartialEq, Eq, Clone, Hash, SystemSet)]
pub struct InputSystem;

Expand Down Expand Up @@ -148,11 +149,14 @@ impl Plugin for InputPlugin {
reflect(Serialize, Deserialize)
)]
pub enum ButtonState {
/// The button is pressed.
Pressed,
/// The button is not pressed.
Released,
}

impl ButtonState {
/// Is this button pressed?
pub fn is_pressed(&self) -> bool {
matches!(self, ButtonState::Pressed)
}
Expand Down

0 comments on commit b9ab17e

Please sign in to comment.