1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:07:52 +08:00

ILegacyScoreProcessor -> ILegacyScoreSimulator

This commit is contained in:
Dean Herbert 2023-07-04 17:32:54 +09:00
parent 3b5f3b67a7
commit 1629024111
15 changed files with 38 additions and 35 deletions

View File

@ -202,7 +202,7 @@ namespace osu.Game.Rulesets.Catch
public int LegacyID => 2; public int LegacyID => 2;
public ILegacyScoreProcessor CreateLegacyScoreProcessor() => new CatchLegacyScoreProcessor(); public ILegacyScoreSimulator CreateLegacyScoreSimulator() => new CatchLegacyScoreSimulator();
public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new CatchReplayFrame(); public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new CatchReplayFrame();

View File

@ -51,11 +51,11 @@ namespace osu.Game.Rulesets.Catch.Difficulty
if (ComputeLegacyScoringValues) if (ComputeLegacyScoringValues)
{ {
CatchLegacyScoreProcessor sv1Processor = new CatchLegacyScoreProcessor(); CatchLegacyScoreSimulator sv1Simulator = new CatchLegacyScoreSimulator();
sv1Processor.Simulate(workingBeatmap, beatmap, mods); sv1Simulator.Simulate(workingBeatmap, beatmap, mods);
attributes.LegacyAccuracyScore = sv1Processor.AccuracyScore; attributes.LegacyAccuracyScore = sv1Simulator.AccuracyScore;
attributes.LegacyComboScore = sv1Processor.ComboScore; attributes.LegacyComboScore = sv1Simulator.ComboScore;
attributes.LegacyBonusScoreRatio = sv1Processor.BonusScoreRatio; attributes.LegacyBonusScoreRatio = sv1Simulator.BonusScoreRatio;
} }
return attributes; return attributes;

View File

@ -14,7 +14,7 @@ using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Catch.Difficulty namespace osu.Game.Rulesets.Catch.Difficulty
{ {
internal class CatchLegacyScoreProcessor : ILegacyScoreProcessor internal class CatchLegacyScoreSimulator : ILegacyScoreSimulator
{ {
public int AccuracyScore { get; private set; } public int AccuracyScore { get; private set; }

View File

@ -62,11 +62,11 @@ namespace osu.Game.Rulesets.Mania.Difficulty
if (ComputeLegacyScoringValues) if (ComputeLegacyScoringValues)
{ {
ManiaLegacyScoreProcessor sv1Processor = new ManiaLegacyScoreProcessor(); ManiaLegacyScoreSimulator sv1Simulator = new ManiaLegacyScoreSimulator();
sv1Processor.Simulate(workingBeatmap, beatmap, mods); sv1Simulator.Simulate(workingBeatmap, beatmap, mods);
attributes.LegacyAccuracyScore = sv1Processor.AccuracyScore; attributes.LegacyAccuracyScore = sv1Simulator.AccuracyScore;
attributes.LegacyComboScore = sv1Processor.ComboScore; attributes.LegacyComboScore = sv1Simulator.ComboScore;
attributes.LegacyBonusScoreRatio = sv1Processor.BonusScoreRatio; attributes.LegacyBonusScoreRatio = sv1Simulator.BonusScoreRatio;
} }
return attributes; return attributes;

View File

@ -10,7 +10,7 @@ using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Mania.Difficulty namespace osu.Game.Rulesets.Mania.Difficulty
{ {
internal class ManiaLegacyScoreProcessor : ILegacyScoreProcessor internal class ManiaLegacyScoreSimulator : ILegacyScoreSimulator
{ {
public int AccuracyScore => 0; public int AccuracyScore => 0;
public int ComboScore { get; private set; } public int ComboScore { get; private set; }

View File

@ -302,7 +302,7 @@ namespace osu.Game.Rulesets.Mania
public int LegacyID => 3; public int LegacyID => 3;
public ILegacyScoreProcessor CreateLegacyScoreProcessor() => new ManiaLegacyScoreProcessor(); public ILegacyScoreSimulator CreateLegacyScoreSimulator() => new ManiaLegacyScoreSimulator();
public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new ManiaReplayFrame(); public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new ManiaReplayFrame();

View File

@ -111,11 +111,11 @@ namespace osu.Game.Rulesets.Osu.Difficulty
if (ComputeLegacyScoringValues) if (ComputeLegacyScoringValues)
{ {
OsuLegacyScoreProcessor sv1Processor = new OsuLegacyScoreProcessor(); OsuLegacyScoreSimulator sv1Simulator = new OsuLegacyScoreSimulator();
sv1Processor.Simulate(workingBeatmap, beatmap, mods); sv1Simulator.Simulate(workingBeatmap, beatmap, mods);
attributes.LegacyAccuracyScore = sv1Processor.AccuracyScore; attributes.LegacyAccuracyScore = sv1Simulator.AccuracyScore;
attributes.LegacyComboScore = sv1Processor.ComboScore; attributes.LegacyComboScore = sv1Simulator.ComboScore;
attributes.LegacyBonusScoreRatio = sv1Processor.BonusScoreRatio; attributes.LegacyBonusScoreRatio = sv1Simulator.BonusScoreRatio;
} }
return attributes; return attributes;

View File

@ -14,7 +14,7 @@ using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Osu.Difficulty namespace osu.Game.Rulesets.Osu.Difficulty
{ {
internal class OsuLegacyScoreProcessor : ILegacyScoreProcessor internal class OsuLegacyScoreSimulator : ILegacyScoreSimulator
{ {
public int AccuracyScore { get; private set; } public int AccuracyScore { get; private set; }

View File

@ -253,7 +253,7 @@ namespace osu.Game.Rulesets.Osu
public int LegacyID => 0; public int LegacyID => 0;
public ILegacyScoreProcessor CreateLegacyScoreProcessor() => new OsuLegacyScoreProcessor(); public ILegacyScoreSimulator CreateLegacyScoreSimulator() => new OsuLegacyScoreSimulator();
public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new OsuReplayFrame(); public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new OsuReplayFrame();

View File

@ -101,11 +101,11 @@ namespace osu.Game.Rulesets.Taiko.Difficulty
if (ComputeLegacyScoringValues) if (ComputeLegacyScoringValues)
{ {
TaikoLegacyScoreProcessor sv1Processor = new TaikoLegacyScoreProcessor(); TaikoLegacyScoreSimulator sv1Simulator = new TaikoLegacyScoreSimulator();
sv1Processor.Simulate(workingBeatmap, beatmap, mods); sv1Simulator.Simulate(workingBeatmap, beatmap, mods);
attributes.LegacyAccuracyScore = sv1Processor.AccuracyScore; attributes.LegacyAccuracyScore = sv1Simulator.AccuracyScore;
attributes.LegacyComboScore = sv1Processor.ComboScore; attributes.LegacyComboScore = sv1Simulator.ComboScore;
attributes.LegacyBonusScoreRatio = sv1Processor.BonusScoreRatio; attributes.LegacyBonusScoreRatio = sv1Simulator.BonusScoreRatio;
} }
return attributes; return attributes;

View File

@ -14,7 +14,7 @@ using osu.Game.Rulesets.Taiko.Objects;
namespace osu.Game.Rulesets.Taiko.Difficulty namespace osu.Game.Rulesets.Taiko.Difficulty
{ {
internal class TaikoLegacyScoreProcessor : ILegacyScoreProcessor internal class TaikoLegacyScoreSimulator : ILegacyScoreSimulator
{ {
public int AccuracyScore { get; private set; } public int AccuracyScore { get; private set; }

View File

@ -197,7 +197,7 @@ namespace osu.Game.Rulesets.Taiko
public int LegacyID => 1; public int LegacyID => 1;
public ILegacyScoreProcessor CreateLegacyScoreProcessor() => new TaikoLegacyScoreProcessor(); public ILegacyScoreSimulator CreateLegacyScoreSimulator() => new TaikoLegacyScoreSimulator();
public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new TaikoReplayFrame(); public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new TaikoReplayFrame();

View File

@ -205,15 +205,15 @@ namespace osu.Game.Database
if (ruleset is not ILegacyRuleset legacyRuleset) if (ruleset is not ILegacyRuleset legacyRuleset)
return score.TotalScore; return score.TotalScore;
ILegacyScoreProcessor sv1Processor = legacyRuleset.CreateLegacyScoreProcessor(); ILegacyScoreSimulator sv1Simulator = legacyRuleset.CreateLegacyScoreSimulator();
sv1Processor.Simulate(beatmap, beatmap.GetPlayableBeatmap(ruleset.RulesetInfo, score.Mods), score.Mods); sv1Simulator.Simulate(beatmap, beatmap.GetPlayableBeatmap(ruleset.RulesetInfo, score.Mods), score.Mods);
return ConvertFromLegacyTotalScore(score, new DifficultyAttributes return ConvertFromLegacyTotalScore(score, new DifficultyAttributes
{ {
LegacyAccuracyScore = sv1Processor.AccuracyScore, LegacyAccuracyScore = sv1Simulator.AccuracyScore,
LegacyComboScore = sv1Processor.ComboScore, LegacyComboScore = sv1Simulator.ComboScore,
LegacyBonusScoreRatio = sv1Processor.BonusScoreRatio LegacyBonusScoreRatio = sv1Simulator.BonusScoreRatio
}); });
} }

View File

@ -14,6 +14,6 @@ namespace osu.Game.Rulesets
/// </summary> /// </summary>
int LegacyID { get; } int LegacyID { get; }
ILegacyScoreProcessor CreateLegacyScoreProcessor(); ILegacyScoreSimulator CreateLegacyScoreSimulator();
} }
} }

View File

@ -7,7 +7,10 @@ using osu.Game.Rulesets.Mods;
namespace osu.Game.Rulesets.Scoring namespace osu.Game.Rulesets.Scoring
{ {
public interface ILegacyScoreProcessor /// <summary>
/// Generates attributes which are required to calculate old-style Score V1 scores.
/// </summary>
public interface ILegacyScoreSimulator
{ {
/// <summary> /// <summary>
/// The accuracy portion of the legacy (ScoreV1) total score. /// The accuracy portion of the legacy (ScoreV1) total score.