Represents a set of buttons that can be networked.
More...
Inherits INetworkStruct, and IEquatable< NetworkButtons >.
|
int | _bits |
|
| NetworkButtons |
| Gets the buttons that were pressed or released since the previous state. More...
|
|
|
int | Bits [get] |
| Gets the bits representing the state of the buttons. More...
|
|
Represents a set of buttons that can be networked.
◆ NetworkButtons()
Initializes a new instance of the NetworkButtons struct with the specified buttons state.
- Parameters
-
buttons | The integer representing the state of the buttons. |
◆ Equals() [1/2]
◆ Equals() [2/2]
override bool Equals |
( |
object |
obj | ) |
|
Determines whether the specified object is equal to the current NetworkButtons.
- Parameters
-
- Returns
- true if the specified object is equal to the current NetworkButtons; otherwise, false.
◆ GetHashCode()
override int GetHashCode |
( |
| ) |
|
Serves as the default hash function.
- Returns
- A hash code for the current NetworkButtons.
◆ GetPressed()
Gets the buttons that were pressed since the previous state.
- Parameters
-
previous | The previous state of the buttons. |
- Returns
- The buttons that were pressed.
◆ GetReleased()
Gets the buttons that were released since the previous state.
- Parameters
-
previous | The previous state of the buttons. |
- Returns
- The buttons that were released.
◆ IsSet()
Checks if the button at the specified index is set.
- Parameters
-
button | The index of the button to check. |
- Returns
- true if the button is set; otherwise, false.
◆ IsSet< T >()
bool IsSet< T > |
( |
T |
button | ) |
|
Checks if the button of the specified enum type is set.
- Template Parameters
-
T | The enum type of the button. |
- Parameters
-
button | The button of type T to check. |
- Returns
- true if the button is set; otherwise, false.
◆ Set()
void Set |
( |
int |
button, |
|
|
bool |
state |
|
) |
| |
Sets the button at the specified index to the specified state.
- Parameters
-
button | The index of the button to set. |
state | The state to set the button to. |
◆ Set< T >()
void Set< T > |
( |
T |
button, |
|
|
bool |
state |
|
) |
| |
Sets the button of the specified enum type to the specified state.
- Template Parameters
-
T | The enum type of the button. |
- Parameters
-
button | The button of type T to set. |
state | The state to set the button to. |
◆ SetAllDown()
Sets all buttons to down.
◆ SetAllUp()
◆ SetDown()
void SetDown |
( |
int |
button | ) |
|
Sets the button at the specified index to down.
- Parameters
-
button | The index of the button to set to down. |
◆ SetDown< T >()
Sets the button of the specified enum type to down.
- Template Parameters
-
T | The enum type of the button. |
- Parameters
-
button | The button of type T to set to down. |
◆ SetUp()
Sets the button at the specified index to up.
- Parameters
-
button | The index of the button to set to up. |
◆ SetUp< T >()
void SetUp< T > |
( |
T |
button | ) |
|
Sets the button of the specified enum type to up.
- Template Parameters
-
T | The enum type of the button. |
- Parameters
-
button | The button of type T to set to up. |
◆ WasPressed()
Checks if the button at the specified index was pressed since the previous state.
- Parameters
-
previous | The previous state of the buttons. |
button | The index of the button to check. |
- Returns
- true if the button was pressed; otherwise, false.
◆ WasPressed< T >()
Checks if the button of the specified enum type was pressed since the previous state.
- Template Parameters
-
T | The enum type of the button. |
- Parameters
-
previous | The previous state of the buttons. |
button | The button of type T to check. |
- Returns
- true if the button was pressed; otherwise, false.
◆ WasReleased()
Checks if the button at the specified index was released since the previous state.
- Parameters
-
previous | The previous state of the buttons. |
button | The index of the button to check. |
- Returns
- true if the button was released; otherwise, false.
◆ WasReleased< T >()
Checks if the button of the specified enum type was released since the previous state.
- Template Parameters
-
T | The enum type of the button. |
- Parameters
-
previous | The previous state of the buttons. |
button | The button of type T to check. |
- Returns
- true if the button was released; otherwise, false.
◆ NetworkButtons
Gets the buttons that were pressed or released since the previous state.
- Parameters
-
previous | The previous state of the buttons. |
- Returns
- A tuple containing the buttons that were pressed and the buttons that were released.
◆ Bits
Gets the bits representing the state of the buttons.