mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 14:46:38 +09:00
Make categoryDifficulties return doubles to improve decimal accuracy
This commit is contained in:
@ -14,7 +14,7 @@ namespace osu.Game.Beatmaps
|
||||
{
|
||||
protected double TimeRate = 1;
|
||||
|
||||
public abstract double Calculate(Dictionary<string, string> categoryDifficulty = null);
|
||||
public abstract double Calculate(Dictionary<string, double> categoryDifficulty = null);
|
||||
}
|
||||
|
||||
public abstract class DifficultyCalculator<T> : DifficultyCalculator where T : HitObject
|
||||
|
@ -9,14 +9,14 @@ namespace osu.Game.Rulesets.Scoring
|
||||
{
|
||||
public abstract class PerformanceCalculator
|
||||
{
|
||||
public abstract double Calculate(Dictionary<string, string> categoryDifficulty = null);
|
||||
public abstract double Calculate(Dictionary<string, double> categoryDifficulty = null);
|
||||
}
|
||||
|
||||
public abstract class PerformanceCalculator<TObject> : PerformanceCalculator
|
||||
where TObject : HitObject
|
||||
{
|
||||
private readonly Dictionary<string, string> attributes = new Dictionary<string, string>();
|
||||
protected IDictionary<string, string> Attributes => attributes;
|
||||
private readonly Dictionary<string, double> attributes = new Dictionary<string, double>();
|
||||
protected IDictionary<string, double> Attributes => attributes;
|
||||
|
||||
protected readonly Beatmap<TObject> Beatmap;
|
||||
protected readonly Score Score;
|
||||
|
@ -259,7 +259,7 @@ namespace osu.Game.Tests.Visual
|
||||
if (calculator == null)
|
||||
return;
|
||||
|
||||
var attributes = new Dictionary<string, string>();
|
||||
var attributes = new Dictionary<string, double>();
|
||||
double performance = calculator.Calculate(attributes);
|
||||
|
||||
text.Text = $"{score.User.Username} -> online: {score.PP:n2}pp | local: {performance:n2}pp";
|
||||
@ -364,12 +364,12 @@ namespace osu.Game.Tests.Visual
|
||||
var diffCalc = ruleset.CreateDifficultyCalculator(beatmap.Beatmap, activeMods);
|
||||
if (diffCalc != null)
|
||||
{
|
||||
var categories = new Dictionary<string, string>();
|
||||
var categories = new Dictionary<string, double>();
|
||||
double totalSr = diffCalc.Calculate(categories);
|
||||
|
||||
totalText.Text = $"Star rating: {totalSr:n2}";
|
||||
foreach (var kvp in categories)
|
||||
categoryTexts.Add(new OsuSpriteText { Text = $"{kvp.Key}: {kvp.Value}" });
|
||||
categoryTexts.Add(new OsuSpriteText { Text = $"{kvp.Key}: {kvp.Value:n2}" });
|
||||
}
|
||||
|
||||
informationCache.Validate();
|
||||
|
Reference in New Issue
Block a user