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 @@ 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);
}
}

View File

@ -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)

View File

@ -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;
}

View File

@ -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

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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;
}