Add documentation to Controller DigitalState and AnalogState to prevent confusiong between the Pressed and Active values

This commit is contained in:
Herman Groenenboom 2023-04-07 10:56:00 +02:00
parent d19f420a24
commit 8a6c389e1f

View File

@ -100,6 +100,9 @@ public struct AnalogState
public float X; // x float public float X; // x float
public float Y; // y float public float Y; // y float
internal byte BActive; // bActive byte internal byte BActive; // bActive byte
/// <summary>
/// Whether or not this action is currently available to be bound in the active action set. If it is not available, OR does not belong to the active action set, this will be false.
/// </summary>
public bool Active => BActive != 0; public bool Active => BActive != 0;
} }
@ -126,7 +129,13 @@ public struct DigitalState
[MarshalAs( UnmanagedType.I1 )] [MarshalAs( UnmanagedType.I1 )]
internal byte BActive; // bActive byte internal byte BActive; // bActive byte
/// <summary>
/// The current state of this action; true if the action is currently pressed, otherwise false.
/// </summary>
public bool Pressed => BState != 0; public bool Pressed => BState != 0;
/// <summary>
/// Whether or not this action is currently available to be bound in the active action set.
/// </summary>
public bool Active => BActive != 0; public bool Active => BActive != 0;
} }
} }