mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 02:02:53 +08:00
Ensure PerformanceBreakdown
pieces cannot be null
This commit is contained in:
parent
9cba24e32c
commit
6edaf4f230
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Difficulty
|
namespace osu.Game.Rulesets.Difficulty
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -19,5 +17,16 @@ namespace osu.Game.Rulesets.Difficulty
|
|||||||
/// Performance of a perfect play for comparison.
|
/// Performance of a perfect play for comparison.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public PerformanceAttributes PerfectPerformance { get; set; }
|
public PerformanceAttributes PerfectPerformance { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create a new performance breakdown.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="performance">Actual gameplay performance.</param>
|
||||||
|
/// <param name="perfectPerformance">Performance of a perfect play for comparison.</param>
|
||||||
|
public PerformanceBreakdown(PerformanceAttributes performance, PerformanceAttributes perfectPerformance)
|
||||||
|
{
|
||||||
|
Performance = performance;
|
||||||
|
PerfectPerformance = perfectPerformance;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ namespace osu.Game.Rulesets.Difficulty
|
|||||||
getPerfectPerformance(score, cancellationToken)
|
getPerfectPerformance(score, cancellationToken)
|
||||||
).ConfigureAwait(false);
|
).ConfigureAwait(false);
|
||||||
|
|
||||||
return new PerformanceBreakdown { Performance = performanceArray[0], PerfectPerformance = performanceArray[1] };
|
return new PerformanceBreakdown(performanceArray[0] ?? new PerformanceAttributes(), performanceArray[1] ?? new PerformanceAttributes());
|
||||||
}
|
}
|
||||||
|
|
||||||
[ItemCanBeNull]
|
[ItemCanBeNull]
|
||||||
|
Loading…
Reference in New Issue
Block a user