mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 21:02:55 +08:00
Throw exception on access before ApplyBeatmap()
This commit is contained in:
parent
e551e48697
commit
055845d4f5
@ -93,7 +93,18 @@ namespace osu.Game.Rulesets.Scoring
|
||||
/// <summary>
|
||||
/// Scoring values for a perfect play.
|
||||
/// </summary>
|
||||
public ScoringValues MaximumScoringValues { get; private set; }
|
||||
public ScoringValues MaximumScoringValues
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!beatmapApplied)
|
||||
throw new InvalidOperationException($"Cannot access maximum scoring values before calling {nameof(ApplyBeatmap)}.");
|
||||
|
||||
return maximumScoringValues;
|
||||
}
|
||||
}
|
||||
|
||||
private ScoringValues maximumScoringValues;
|
||||
|
||||
/// <summary>
|
||||
/// Scoring values for the current play assuming all perfect hits.
|
||||
@ -255,7 +266,7 @@ namespace osu.Game.Rulesets.Scoring
|
||||
private void updateScore()
|
||||
{
|
||||
Accuracy.Value = currentMaximumScoringValues.BaseScore > 0 ? currentScoringValues.BaseScore / currentMaximumScoringValues.BaseScore : 1;
|
||||
TotalScore.Value = ComputeScore(Mode.Value, currentScoringValues, MaximumScoringValues);
|
||||
TotalScore.Value = ComputeScore(Mode.Value, currentScoringValues, maximumScoringValues);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -406,7 +417,7 @@ namespace osu.Game.Rulesets.Scoring
|
||||
lastHitObject = null;
|
||||
|
||||
if (storeResults)
|
||||
MaximumScoringValues = currentScoringValues;
|
||||
maximumScoringValues = currentScoringValues;
|
||||
|
||||
currentScoringValues = default;
|
||||
currentMaximumScoringValues = default;
|
||||
|
Loading…
Reference in New Issue
Block a user