Esempio n. 1
0
 public Controller AddAxis(Enum name, Axis a = null) {
     AddAxis(Util.EnumValueToString(name), a);
     return this;
 }
Esempio n. 2
0
 public Controller AddAxis(string name, Axis a = null) {
     axes.Add(name, a == null ? new Axis() : a);
     return this;
 }
Esempio n. 3
0
        /// <summary>
        /// Add another Axis to this Axis.
        /// </summary>
        /// <param name="source">The source Axis to use.</param>
        /// <returns>This Axis.</returns>
        public Axis AddAxis(Axis source) {
            foreach (Direction d in Enum.GetValues(typeof(Direction))) {
                // Copy keys from source Axis.
                Keys[d].AddRange(source.Keys[d]);
                for (int i = 0; i < Joystick.Count; i++) {
                    // Copy buttons from source Axis.
                    JoyButtons[d].AddRange(source.JoyButtons[d]);
                }
            }

            for (int i = 0; i < Joystick.Count; i++) {
                // Copy joy axes from source Axis.
                AxesX[i].AddRange(source.AxesX[i]);
                AxesY[i].AddRange(source.AxesY[i]);
            }

            return this;
        }