예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GorgonGamingDeviceAxisInfo"/> struct.
 /// </summary>
 /// <param name="axis">The identifier for the axis.</param>
 /// <param name="range">The range of the axis.</param>
 /// <param name="defaultValue">The default value for the axis when in resting position.</param>
 public GorgonGamingDeviceAxisInfo(GamingDeviceAxis axis, GorgonRange range, int defaultValue)
 {
     Axis         = axis;
     Range        = range;
     DefaultValue = defaultValue;
 }
 /// <summary>
 /// Function to retrieve a <see cref="GorgonGamingDeviceAxisInfo"/>.
 /// </summary>
 /// <param name="axis">The axis to look up.</param>
 /// <param name="result">The <see cref="GorgonGamingDeviceAxisInfo"/> specified by the axis.</param>
 /// <returns><b>true</b> if the axis was found in this list, or <b>false</b> if not.</returns>
 /// <remarks>
 /// If the <paramref name="axis"/> was not found, then the <paramref name="result"/> parameter will return a <see cref="GorgonGamingDeviceAxisInfo"/> with default values. Because of this, it is strongly
 /// recommened to use the method return value to determine if the item exists or not.
 /// </remarks>
 public bool TryGetValue(GamingDeviceAxis axis, out T result) => _infoList.TryGetValue(axis, out result);
 /// <summary>
 /// Property to return the range for the specified <see cref="GamingDeviceAxis"/>.
 /// </summary>
 public T this[GamingDeviceAxis axis] => _infoList[axis];
 /// <summary>
 /// Function to determine if a specific <see cref="GamingDeviceAxis"/> is supported.
 /// </summary>
 /// <param name="axis">Axis to look up.</param>
 /// <returns><b>true</b> if the axis is supported, <b>false</b> if not.</returns>
 public bool Contains(GamingDeviceAxis axis) => _infoList.ContainsKey(axis);