bevy/crates/bevy_input/src
KDecay 51509a9a3e Change gamepad.rs tuples to normal structs (#4519)
# Objective

- Part of the splitting process of #3692.

## Solution

- Remove / change the tuple structs inside of `gamepad.rs` of `bevy_input` to normal structs.

## Reasons

- It made the `gamepad_connection_system` cleaner.
- It made the `gamepad_input_events.rs` example cleaner (which is probably the most notable change for the user facing API).
- Tuple structs are not descriptive (`.0`, `.1`).
- Using tuple structs for more than 1 field is a bad idea (This means that the `Gamepad` type might be fine as a tuple struct, but I still prefer normal structs over tuple structs).

Feel free to discuss this change as this is more or less just a matter of taste.

## Changelog

### Changed

- The `Gamepad`, `GamepadButton`, `GamepadAxis`, `GamepadEvent` and `GamepadEventRaw` types are now normal structs instead of tuple structs and have a `new()` function.

## Migration Guide

- The `Gamepad`, `GamepadButton`, `GamepadAxis`, `GamepadEvent` and `GamepadEventRaw` types are now normal structs instead of tuple structs and have a `new()` function. To migrate change every instantiation to use the `new()` function instead and use the appropriate field names instead of `.0` and `.1`.
2022-05-02 13:20:55 +00:00
..
axis.rs Change gamepad.rs tuples to normal structs (#4519) 2022-05-02 13:20:55 +00:00
gamepad.rs Change gamepad.rs tuples to normal structs (#4519) 2022-05-02 13:20:55 +00:00
input.rs Add more tests to input.rs (#4522) 2022-04-25 13:16:24 +00:00
keyboard.rs Rename ElementState to ButtonState (#4314) 2022-04-24 22:57:02 +00:00
lib.rs Rename ElementState to ButtonState (#4314) 2022-04-24 22:57:02 +00:00
mouse.rs Update mouse.rs docs in bevy_input (#4518) 2022-04-26 17:32:54 +00:00
system.rs Rename ElementState to ButtonState (#4314) 2022-04-24 22:57:02 +00:00
touch.rs Update touch.rs docs (#4523) 2022-04-18 18:25:44 +00:00