mirror of
https://github.com/ppy/osu
synced 2025-01-10 16:19:47 +00:00
Extract helper function for pp value handling
This commit is contained in:
parent
d4ba9d2682
commit
68b505ab86
@ -28,19 +28,21 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics
|
||||
{
|
||||
if (score.PP.HasValue)
|
||||
{
|
||||
performance.Value = (int)Math.Round(score.PP.Value, MidpointRounding.AwayFromZero);
|
||||
setPerformanceValue(score.PP.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
performanceManager.CalculatePerformanceAsync(score, cancellationTokenSource.Token)
|
||||
.ContinueWith(t => Schedule(() =>
|
||||
{
|
||||
if (t.Result.HasValue)
|
||||
performance.Value = (int)Math.Round(t.Result.Value, MidpointRounding.AwayFromZero);
|
||||
}), cancellationTokenSource.Token);
|
||||
.ContinueWith(t => Schedule(() => setPerformanceValue(t.Result)), cancellationTokenSource.Token);
|
||||
}
|
||||
}
|
||||
|
||||
private void setPerformanceValue(double? pp)
|
||||
{
|
||||
if (pp.HasValue)
|
||||
performance.Value = (int)Math.Round(pp.Value, MidpointRounding.AwayFromZero);
|
||||
}
|
||||
|
||||
public override void Appear()
|
||||
{
|
||||
base.Appear();
|
||||
|
Loading…
Reference in New Issue
Block a user