Beispiel #1
0
        /// <summary>
        /// Initialize a new instance of <see cref="Joypad"/>
        /// </summary>
        /// <param name="system">What <see cref="SystemInfo"/> this <see cref="Joypad"/> is used for</param>
        /// <param name="player">Which player this controller is assigned to</param>
        internal Joypad(SystemInfo system, int player)
        {
            if (player < 1 || player > system.MaxControllers)
            {
                throw new InvalidOperationException(string.Format("{0} is invalid for {1}", player, system.DisplayName));
            }

            _System = system;
            _Player = player;
        }
Beispiel #2
0
 /// <summary>
 /// Convert a <see cref="JoypadButton"/> value to BizHawk <see cref="string"/>
 /// </summary>
 /// <param name="button"><see cref="JoypadButton"/> you want to convert</param>
 /// <param name="system">Current <see cref="SystemInfo"/></param>
 /// <returns>A <see cref="string"/> that is used by BizHawk</returns>
 /// <exception cref="IndexOutOfRangeException">Thrown when <see cref="JoypadButton"/> hasn't been found</exception>
 public string ConvertBack(JoypadButton button, SystemInfo system)
 {
     return (string)ConvertBack(button, null, system, CultureInfo.CurrentCulture);
 }
Beispiel #3
0
 /// <summary>
 /// Convert a <see cref="JoypadButton"/> value to BizHawk <see cref="string"/>
 /// </summary>
 /// <param name="button"><see cref="JoypadButton"/> you want to convert</param>
 /// <param name="system">Current <see cref="SystemInfo"/></param>
 /// <returns>A <see cref="string"/> that is used by BizHawk</returns>
 /// <exception cref="IndexOutOfRangeException">Thrown when <see cref="JoypadButton"/> hasn't been found</exception>
 public string ConvertBack(JoypadButton button, SystemInfo system)
 {
     return((string)ConvertBack(button, null, system, CultureInfo.CurrentCulture));
 }