1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 12:17:26 +08:00

Remove unnecessary time property

This commit is contained in:
smoogipoo 2020-04-17 17:06:12 +09:00
parent 69fb984e71
commit 9aac98664c
7 changed files with 10 additions and 11 deletions

View File

@ -19,11 +19,10 @@ namespace osu.Game.Beatmaps.ControlPoints
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);
}
}

View File

@ -247,7 +247,7 @@ namespace osu.Game.Beatmaps.ControlPoints
break;
}
return newPoint.IsRedundant(existing, time);
return newPoint.IsRedundant(existing);
}
private void groupItemAdded(ControlPoint controlPoint)

View File

@ -27,7 +27,7 @@ namespace osu.Game.Beatmaps.ControlPoints
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;
}

View File

@ -35,7 +35,7 @@ namespace osu.Game.Beatmaps.ControlPoints
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

View File

@ -68,7 +68,7 @@ namespace osu.Game.Beatmaps.ControlPoints
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;

View File

@ -49,6 +49,6 @@ namespace osu.Game.Beatmaps.ControlPoints
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;
}
}

View File

@ -174,8 +174,8 @@ namespace osu.Game.Beatmaps.Formats
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;
}