mirror of https://github.com/ppy/osu
Remove unnecessary time property
This commit is contained in:
parent
69fb984e71
commit
9aac98664c
|
@ -19,11 +19,10 @@ public abstract class ControlPoint : IComparable<ControlPoint>
|
|||
public int CompareTo(ControlPoint other) => Time.CompareTo(other.Time);
|
||||
|
||||
/// <summary>
|
||||
/// Whether this control point results in a meaningful change when placed after another.
|
||||
/// Determines whether this <see cref="ControlPoint"/> results in a meaningful change when placed alongside another.
|
||||
/// </summary>
|
||||
/// <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 existing, double time);
|
||||
/// <returns>Whether this <see cref="ControlPoint"/> is redundant when placed alongside <paramref name="existing"/>.</returns>
|
||||
public abstract bool IsRedundant(ControlPoint existing);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -247,7 +247,7 @@ private bool checkAlreadyExisting(double time, ControlPoint newPoint)
|
|||
break;
|
||||
}
|
||||
|
||||
return newPoint.IsRedundant(existing, time);
|
||||
return newPoint.IsRedundant(existing);
|
||||
}
|
||||
|
||||
private void groupItemAdded(ControlPoint controlPoint)
|
||||
|
|
|
@ -27,7 +27,7 @@ public double SpeedMultiplier
|
|||
set => SpeedMultiplierBindable.Value = value;
|
||||
}
|
||||
|
||||
public override bool IsRedundant(ControlPoint existing, double time)
|
||||
public override bool IsRedundant(ControlPoint existing)
|
||||
=> existing is DifficultyControlPoint existingDifficulty
|
||||
&& SpeedMultiplier == existingDifficulty.SpeedMultiplier;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ public bool KiaiMode
|
|||
set => KiaiModeBindable.Value = value;
|
||||
}
|
||||
|
||||
public override bool IsRedundant(ControlPoint existing, double time)
|
||||
public override bool IsRedundant(ControlPoint existing)
|
||||
=> !OmitFirstBarLine
|
||||
&& existing is EffectControlPoint existingEffect
|
||||
&& KiaiMode == existingEffect.KiaiMode
|
||||
|
|
|
@ -68,7 +68,7 @@ public virtual HitSampleInfo ApplyTo(HitSampleInfo hitSampleInfo)
|
|||
return newSampleInfo;
|
||||
}
|
||||
|
||||
public override bool IsRedundant(ControlPoint existing, double time)
|
||||
public override bool IsRedundant(ControlPoint existing)
|
||||
=> existing is SampleControlPoint existingSample
|
||||
&& SampleBank == existingSample.SampleBank
|
||||
&& SampleVolume == existingSample.SampleVolume;
|
||||
|
|
|
@ -49,6 +49,6 @@ public double BeatLength
|
|||
public double BPM => 60000 / BeatLength;
|
||||
|
||||
// Timing points are never redundant as they can change the time signature.
|
||||
public override bool IsRedundant(ControlPoint existing, double time) => false;
|
||||
public override bool IsRedundant(ControlPoint existing) => false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -174,8 +174,8 @@ public override HitSampleInfo ApplyTo(HitSampleInfo hitSampleInfo)
|
|||
return baseInfo;
|
||||
}
|
||||
|
||||
public override bool IsRedundant(ControlPoint existing, double time)
|
||||
=> base.IsRedundant(existing, time)
|
||||
public override bool IsRedundant(ControlPoint existing)
|
||||
=> base.IsRedundant(existing)
|
||||
&& existing is LegacySampleControlPoint existingSample
|
||||
&& CustomSampleBank == existingSample.CustomSampleBank;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue