1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 03:27:24 +08:00

Merge remote-tracking branch 'origin/score-test' into score-test

This commit is contained in:
Endrik Tombak 2020-10-09 17:39:01 +03:00
commit d6a3564c01
2 changed files with 15 additions and 4 deletions

View File

@ -150,6 +150,17 @@ namespace osu.Game.Tests.Rulesets.Scoring
Assert.IsTrue(Precision.AlmostEquals(expectedScore, scoreProcessor.TotalScore.Value, 0.5));
}
[Test]
public void TestEmptyBeatmap(
[Values(ScoringMode.Standardised, ScoringMode.Classic)]
ScoringMode scoringMode)
{
scoreProcessor.Mode.Value = scoringMode;
scoreProcessor.ApplyBeatmap(new TestBeatmap(new RulesetInfo()));
Assert.IsTrue(Precision.AlmostEquals(0, scoreProcessor.TotalScore.Value));
}
[TestCase(HitResult.IgnoreHit, HitResult.IgnoreMiss)]
[TestCase(HitResult.Meh, HitResult.Miss)]
[TestCase(HitResult.Ok, HitResult.Miss)]

View File

@ -67,7 +67,7 @@ namespace osu.Game.Rulesets.Scoring
private readonly double accuracyPortion;
private readonly double comboPortion;
private int maxHighestCombo;
private int maxAchievableCombo;
private double maxBaseScore;
private double rollingMaxBaseScore;
private double baseScore;
@ -195,9 +195,9 @@ namespace osu.Game.Rulesets.Scoring
private double getScore(ScoringMode mode)
{
return GetScore(mode, maxHighestCombo,
return GetScore(mode, maxAchievableCombo,
maxBaseScore > 0 ? baseScore / maxBaseScore : 0,
maxHighestCombo > 0 ? (double)HighestCombo.Value / maxHighestCombo : 1,
maxAchievableCombo > 0 ? (double)HighestCombo.Value / maxAchievableCombo : 1,
scoreResultCounts);
}
@ -265,7 +265,7 @@ namespace osu.Game.Rulesets.Scoring
if (storeResults)
{
maxHighestCombo = HighestCombo.Value;
maxAchievableCombo = HighestCombo.Value;
maxBaseScore = baseScore;
}