GamePadAxes axes;
byte gamepad_type;
bool is_connected;
+ bool is_mapped;
#region Constructors
- internal GamePadCapabilities(GamePadType type, GamePadAxes axes, Buttons buttons, bool is_connected)
+ internal GamePadCapabilities(GamePadType type, GamePadAxes axes, Buttons buttons, bool is_connected, bool is_mapped)
: this()
{
gamepad_type = (byte)type;
this.axes = axes;
this.buttons = buttons;
this.is_connected = is_connected;
+ this.is_mapped = is_mapped;
}
#endregion
get { return is_connected; }
}
+ /// <summary>
+ /// Gets a <see cref="System.Boolean"/> value describing whether a valid button configuration
+ /// exists for this <c>GamePad</c> in the GamePad configuration database.
+ /// </summary>
+ public bool IsMapped
+ {
+ get { return is_mapped; }
+ }
+
/// <param name="left">A <see cref="GamePadCapabilities"/> structure to test for equality.</param>
/// <param name="right">A <see cref="GamePadCapabilities"/> structure to test for equality.</param>
public static bool operator ==(GamePadCapabilities left, GamePadCapabilities right)
public override string ToString()
{
return String.Format(
- "{{Type: {0}; Axes: {1}; Buttons: {2}; Connected: {3}}}",
+ "{{Type: {0}; Axes: {1}; Buttons: {2}; {3}; {4}}}",
GamePadType,
Convert.ToString((int)axes, 2),
Convert.ToString((int)buttons, 2),
- IsConnected);
+ IsMapped ? "Mapped" : "Unmapped",
+ IsConnected ? "Connected" : "Disconnected");
}
/// <summary>
return
buttons.GetHashCode() ^
is_connected.GetHashCode() ^
+ is_mapped.GetHashCode() ^
gamepad_type.GetHashCode();
}
return
buttons == other.buttons &&
is_connected == other.is_connected &&
+ is_mapped == other.is_mapped &&
gamepad_type == other.gamepad_type;
}