mirror of
https://github.com/ppy/osu
synced 2025-03-05 10:58:34 +00: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>
|
/// </summary>
|
||||||
/// <param name="existing">An existing control point to compare with.</param>
|
/// <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>
|
/// <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>
|
/// <summary>
|
||||||
/// Create an unbound copy of this control point.
|
/// Create an unbound copy of this control point.
|
||||||
|
@ -40,7 +40,7 @@ namespace osu.Game.Beatmaps.ControlPoints
|
|||||||
set => SliderVelocityBindable.Value = value;
|
set => SliderVelocityBindable.Value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool IsRedundant(ControlPoint existing)
|
public override bool IsRedundant(ControlPoint? existing)
|
||||||
=> existing is DifficultyControlPoint existingDifficulty
|
=> existing is DifficultyControlPoint existingDifficulty
|
||||||
&& SliderVelocity == existingDifficulty.SliderVelocity;
|
&& SliderVelocity == existingDifficulty.SliderVelocity;
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ namespace osu.Game.Beatmaps.ControlPoints
|
|||||||
set => KiaiModeBindable.Value = value;
|
set => KiaiModeBindable.Value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool IsRedundant(ControlPoint existing)
|
public override bool IsRedundant(ControlPoint? existing)
|
||||||
=> !OmitFirstBarLine
|
=> !OmitFirstBarLine
|
||||||
&& existing is EffectControlPoint existingEffect
|
&& existing is EffectControlPoint existingEffect
|
||||||
&& KiaiMode == existingEffect.KiaiMode
|
&& KiaiMode == existingEffect.KiaiMode
|
||||||
|
@ -72,7 +72,7 @@ namespace osu.Game.Beatmaps.ControlPoints
|
|||||||
public virtual HitSampleInfo ApplyTo(HitSampleInfo hitSampleInfo)
|
public virtual HitSampleInfo ApplyTo(HitSampleInfo hitSampleInfo)
|
||||||
=> hitSampleInfo.With(newBank: hitSampleInfo.Bank ?? SampleBank, newVolume: hitSampleInfo.Volume > 0 ? hitSampleInfo.Volume : SampleVolume);
|
=> 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
|
=> existing is SampleControlPoint existingSample
|
||||||
&& SampleBank == existingSample.SampleBank
|
&& SampleBank == existingSample.SampleBank
|
||||||
&& SampleVolume == existingSample.SampleVolume;
|
&& SampleVolume == existingSample.SampleVolume;
|
||||||
|
@ -69,7 +69,7 @@ namespace osu.Game.Beatmaps.ControlPoints
|
|||||||
public double BPM => 60000 / BeatLength;
|
public double BPM => 60000 / BeatLength;
|
||||||
|
|
||||||
// Timing points are never redundant as they can change the time signature.
|
// 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)
|
public override void CopyFrom(ControlPoint other)
|
||||||
{
|
{
|
||||||
|
@ -213,7 +213,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
return baseInfo;
|
return baseInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool IsRedundant(ControlPoint existing)
|
public override bool IsRedundant(ControlPoint? existing)
|
||||||
=> base.IsRedundant(existing)
|
=> base.IsRedundant(existing)
|
||||||
&& existing is LegacySampleControlPoint existingSample
|
&& existing is LegacySampleControlPoint existingSample
|
||||||
&& CustomSampleBank == existingSample.CustomSampleBank;
|
&& CustomSampleBank == existingSample.CustomSampleBank;
|
||||||
|
Loading…
Reference in New Issue
Block a user