Class GameControllerDeviceBase
Base class for gamepads, contains common functionality for gamepad devices
public abstract class GameControllerDeviceBase : IGameControllerDevice, IInputDevice
- Inheritance
-
GameControllerDeviceBase
- Implements
- Extension Methods
Constructors
GameControllerDeviceBase()
protected GameControllerDeviceBase()
Fields
AxisStates
protected float[] AxisStates
Field Value
- float[]
ButtonStates
protected bool[] ButtonStates
Field Value
- bool[]
DirectionStates
protected Direction[] DirectionStates
Field Value
Properties
AxisInfos
Information about the axes on this game controller
public abstract IReadOnlyList<GameControllerAxisInfo> AxisInfos { get; }
Property Value
ButtonInfos
Information about the buttons on this game controller
public abstract IReadOnlyList<GameControllerButtonInfo> ButtonInfos { get; }
Property Value
DirectionInfos
Information about the direction controllers on this game controller
public abstract IReadOnlyList<GameControllerDirectionInfo> DirectionInfos { get; }
Property Value
DownButtons
The buttons that are down
public IReadOnlySet<int> DownButtons { get; }
Property Value
Id
The unique identifier of this device
public abstract Guid Id { get; }
Property Value
Name
The name of the device
public abstract string Name { get; }
Property Value
PressedButtons
The buttons that have been pressed since the last frame
public IReadOnlySet<int> PressedButtons { get; }
Property Value
Priority
The device priority. Larger means higher priority when selecting the first device of some type
public int Priority { get; set; }
Property Value
ProductId
Product Id of the device
public virtual Guid ProductId { get; }
Property Value
ReleasedButtons
The buttons that have been released since the last frame
public IReadOnlySet<int> ReleasedButtons { get; }
Property Value
Source
The input source the device belongs to.
public abstract IInputSource Source { get; }
Property Value
Methods
GetAxis(int)
Retrieves the state of a single axis
public virtual float GetAxis(int index)
Parameters
Returns
- float
The value read directly from the axis
GetDirection(int)
Retrieves the state of a single point of direction controller
public virtual Direction GetDirection(int index)
Parameters
index
intThe direction controller's index, as exposed in DirectionInfos
Returns
- Direction
The current state of the direction controller
HandleAxis(int, float)
protected void HandleAxis(int index, float state)
Parameters
HandleButton(int, bool)
protected void HandleButton(int index, bool state)
Parameters
HandleDirection(int, Direction)
protected void HandleDirection(int index, Direction state)
Parameters
InitializeButtonStates()
Creates the correct amount of states based on the amount of object infos that are set
protected void InitializeButtonStates()
Update(List<InputEvent>)
Raise gamepad events collected by Handle... functions
public virtual void Update(List<InputEvent> inputEvents)
Parameters
inputEvents
List<InputEvent>