1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-23 16:27:20 +08:00

Fix formatting

This commit is contained in:
Alchyr 2020-04-09 09:34:40 -07:00
parent 3d975f30a3
commit f115fecb23
5 changed files with 12 additions and 9 deletions

View File

@ -28,10 +28,10 @@ namespace osu.Game.Beatmaps.ControlPoints
/// <summary>
/// Whether this control point results in a meaningful change when placed after another.
/// </summary>
/// <param name="other">Another control point to compare with.</param>
/// <param name="time">The time this timing point will be placed at.</param>
/// <param name="existing">An existing control point to compare with.</param>
/// <param name="time">The time this control point will be placed at if it is added.</param>
/// <returns>Whether redundant.</returns>
public abstract bool IsRedundant(ControlPoint other, double time);
public abstract bool IsRedundant(ControlPoint existing, double time);
public bool Equals(ControlPoint other) => Time == other?.Time && EquivalentTo(other);
}

View File

@ -29,6 +29,7 @@ namespace osu.Game.Beatmaps.ControlPoints
public override bool EquivalentTo(ControlPoint other) =>
other is DifficultyControlPoint otherTyped && otherTyped.SpeedMultiplier.Equals(SpeedMultiplier);
public override bool IsRedundant(ControlPoint other, double time) => EquivalentTo(other);
public override bool IsRedundant(ControlPoint existing, double time) => EquivalentTo(existing);
}
}

View File

@ -38,6 +38,7 @@ namespace osu.Game.Beatmaps.ControlPoints
public override bool EquivalentTo(ControlPoint other) =>
other is EffectControlPoint otherTyped &&
KiaiMode == otherTyped.KiaiMode && OmitFirstBarLine == otherTyped.OmitFirstBarLine;
public override bool IsRedundant(ControlPoint other, double time) => !OmitFirstBarLine && EquivalentTo(other);
public override bool IsRedundant(ControlPoint existing, double time) => !OmitFirstBarLine && EquivalentTo(existing);
}
}

View File

@ -71,6 +71,7 @@ namespace osu.Game.Beatmaps.ControlPoints
public override bool EquivalentTo(ControlPoint other) =>
other is SampleControlPoint otherTyped &&
SampleBank == otherTyped.SampleBank && SampleVolume == otherTyped.SampleVolume;
public override bool IsRedundant(ControlPoint other, double time) => EquivalentTo(other);
public override bool IsRedundant(ControlPoint existing, double time) => EquivalentTo(existing);
}
}

View File

@ -52,8 +52,8 @@ namespace osu.Game.Beatmaps.ControlPoints
other is TimingControlPoint otherTyped
&& TimeSignature == otherTyped.TimeSignature && BeatLength.Equals(otherTyped.BeatLength);
public override bool IsRedundant(ControlPoint other, double time) =>
EquivalentTo(other)
&& other.Time == time;
public override bool IsRedundant(ControlPoint existing, double time) =>
EquivalentTo(existing)
&& existing.Time == time;
}
}