mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 14:32:55 +08:00
Properly annotate method to allow null
This commit is contained in:
parent
ca287d0936
commit
16281f4a48
@ -28,7 +28,7 @@ namespace osu.Game.Beatmaps.ControlPoints
|
||||
/// </summary>
|
||||
/// <param name="existing">An existing control point to compare with.</param>
|
||||
/// <returns>Whether this <see cref="ControlPoint"/> is redundant when placed alongside <paramref name="existing"/>.</returns>
|
||||
public abstract bool IsRedundant(ControlPoint existing);
|
||||
public abstract bool IsRedundant(ControlPoint? existing);
|
||||
|
||||
/// <summary>
|
||||
/// Create an unbound copy of this control point.
|
||||
|
@ -40,7 +40,7 @@ namespace osu.Game.Beatmaps.ControlPoints
|
||||
set => SliderVelocityBindable.Value = value;
|
||||
}
|
||||
|
||||
public override bool IsRedundant(ControlPoint existing)
|
||||
public override bool IsRedundant(ControlPoint? existing)
|
||||
=> existing is DifficultyControlPoint existingDifficulty
|
||||
&& SliderVelocity == existingDifficulty.SliderVelocity;
|
||||
|
||||
|
@ -67,7 +67,7 @@ namespace osu.Game.Beatmaps.ControlPoints
|
||||
set => KiaiModeBindable.Value = value;
|
||||
}
|
||||
|
||||
public override bool IsRedundant(ControlPoint existing)
|
||||
public override bool IsRedundant(ControlPoint? existing)
|
||||
=> !OmitFirstBarLine
|
||||
&& existing is EffectControlPoint existingEffect
|
||||
&& KiaiMode == existingEffect.KiaiMode
|
||||
|
@ -72,7 +72,7 @@ namespace osu.Game.Beatmaps.ControlPoints
|
||||
public virtual HitSampleInfo ApplyTo(HitSampleInfo hitSampleInfo)
|
||||
=> hitSampleInfo.With(newBank: hitSampleInfo.Bank ?? SampleBank, newVolume: hitSampleInfo.Volume > 0 ? hitSampleInfo.Volume : SampleVolume);
|
||||
|
||||
public override bool IsRedundant(ControlPoint existing)
|
||||
public override bool IsRedundant(ControlPoint? existing)
|
||||
=> existing is SampleControlPoint existingSample
|
||||
&& SampleBank == existingSample.SampleBank
|
||||
&& SampleVolume == existingSample.SampleVolume;
|
||||
|
@ -69,7 +69,7 @@ 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) => false;
|
||||
public override bool IsRedundant(ControlPoint? existing) => false;
|
||||
|
||||
public override void CopyFrom(ControlPoint other)
|
||||
{
|
||||
|
@ -213,7 +213,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
return baseInfo;
|
||||
}
|
||||
|
||||
public override bool IsRedundant(ControlPoint existing)
|
||||
public override bool IsRedundant(ControlPoint? existing)
|
||||
=> base.IsRedundant(existing)
|
||||
&& existing is LegacySampleControlPoint existingSample
|
||||
&& CustomSampleBank == existingSample.CustomSampleBank;
|
||||
|
Loading…
Reference in New Issue
Block a user