/// <summary> /// Adds the axis to the machine. /// Intended to be called on loading the axes from the machine. /// If there is an identical axis already locally saved, it does nothing. /// </summary> /// <param name="axis">InputAxis object.</param> public static void AddMachineAxis(InputAxis axis) { if (LocalAxes.ContainsKey(axis.Name) && axis.Equals(LocalAxes[axis.Name])) { return; } MachineAxes[axis.Name] = axis; }
/// <summary> /// Compares axis tuning parameters. /// </summary> /// <param name="other">Axis to compare with.</param> /// <returns>Returns true if axes are identical.</returns> public override bool Equals(InputAxis other) { var cast = other as MouseAxis; if (cast == null) { return(false); } return(this.Name == cast.Name && this.Axis == cast.Axis && this.Center == cast.Center && this.Range == cast.Range); }
/// <summary> /// Compares axis tuning parameters. /// </summary> /// <param name="other">Axis to compare with.</param> /// <returns>Returns true if axes are identical.</returns> public override bool Equals(InputAxis other) { var cast = other as ChainAxis; if (cast == null) { return(false); } return(this.Name == cast.Name && this.Method == cast.Method && this.SubAxis1 == cast.SubAxis1 && this.SubAxis2 == cast.SubAxis2); }
/// <summary> /// Compares axis tuning parameters. /// </summary> /// <param name="other">Axis to compare with.</param> /// <returns>Returns true if axes are identical.</returns> public override bool Equals(InputAxis other) { var cast = other as CustomAxis; if (cast == null) { return(false); } return(this.Name == cast.Name && this.InitialisationCode == cast.InitialisationCode && this.UpdateCode == cast.UpdateCode && this.GlobalScope == cast.GlobalScope); }
/// <summary> /// Compares axis tuning parameters. /// </summary> /// <param name="other">Axis to compare with.</param> /// <returns>Returns true if axes are identical.</returns> public override bool Equals(InputAxis other) { var cast = other as KeyAxis; if (cast == null) { return(false); } return(this.Name == cast.Name && this.Sensitivity == cast.Sensitivity && this.Gravity == cast.Gravity && this.Snap == cast.Snap && this.Raw == cast.Raw && this.PositiveBind == cast.PositiveBind && this.NegativeBind == cast.NegativeBind); }
/// <summary> /// Saves the axis locally. /// Overwrites axis if saved under an existing name. /// </summary> /// <param name="axis">InputAxis object.</param> public static void AddLocalAxis(InputAxis axis) { // overwrite existing axis or create new if (LocalAxes.ContainsKey(axis.Name)) { LocalAxes[axis.Name].Delete(); LocalAxes[axis.Name] = axis; } else { LocalAxes.Add(axis.Name, axis); } // remove axis in machine embedded axis list if (MachineAxes.ContainsKey(axis.Name)) { RemoveMachineAxis(axis.Name); } }
/// <summary> /// Compares axis tuning parameters. /// </summary> /// <param name="other">Axis to compare with.</param> /// <returns>Returns true if axes are identical.</returns> public override bool Equals(InputAxis other) { var cast = other as ControllerAxis; if (cast == null) { return(false); } return(this.Name == cast.Name && this.GUID == cast.GUID && this.Axis == cast.Axis && this.Sensitivity == cast.Sensitivity && this.Curvature == cast.Curvature && this.Deadzone == cast.Deadzone && this.OffsetX == cast.OffsetX && this.OffsetY == cast.OffsetY && this.Invert == cast.Invert && this.Smooth == cast.Smooth); }