mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:27:29 +08:00
ILegacyScoreProcessor
-> ILegacyScoreSimulator
This commit is contained in:
parent
3b5f3b67a7
commit
1629024111
@ -202,7 +202,7 @@ namespace osu.Game.Rulesets.Catch
|
||||
|
||||
public int LegacyID => 2;
|
||||
|
||||
public ILegacyScoreProcessor CreateLegacyScoreProcessor() => new CatchLegacyScoreProcessor();
|
||||
public ILegacyScoreSimulator CreateLegacyScoreSimulator() => new CatchLegacyScoreSimulator();
|
||||
|
||||
public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new CatchReplayFrame();
|
||||
|
||||
|
@ -51,11 +51,11 @@ namespace osu.Game.Rulesets.Catch.Difficulty
|
||||
|
||||
if (ComputeLegacyScoringValues)
|
||||
{
|
||||
CatchLegacyScoreProcessor sv1Processor = new CatchLegacyScoreProcessor();
|
||||
sv1Processor.Simulate(workingBeatmap, beatmap, mods);
|
||||
attributes.LegacyAccuracyScore = sv1Processor.AccuracyScore;
|
||||
attributes.LegacyComboScore = sv1Processor.ComboScore;
|
||||
attributes.LegacyBonusScoreRatio = sv1Processor.BonusScoreRatio;
|
||||
CatchLegacyScoreSimulator sv1Simulator = new CatchLegacyScoreSimulator();
|
||||
sv1Simulator.Simulate(workingBeatmap, beatmap, mods);
|
||||
attributes.LegacyAccuracyScore = sv1Simulator.AccuracyScore;
|
||||
attributes.LegacyComboScore = sv1Simulator.ComboScore;
|
||||
attributes.LegacyBonusScoreRatio = sv1Simulator.BonusScoreRatio;
|
||||
}
|
||||
|
||||
return attributes;
|
||||
|
@ -14,7 +14,7 @@ using osu.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.Difficulty
|
||||
{
|
||||
internal class CatchLegacyScoreProcessor : ILegacyScoreProcessor
|
||||
internal class CatchLegacyScoreSimulator : ILegacyScoreSimulator
|
||||
{
|
||||
public int AccuracyScore { get; private set; }
|
||||
|
@ -62,11 +62,11 @@ namespace osu.Game.Rulesets.Mania.Difficulty
|
||||
|
||||
if (ComputeLegacyScoringValues)
|
||||
{
|
||||
ManiaLegacyScoreProcessor sv1Processor = new ManiaLegacyScoreProcessor();
|
||||
sv1Processor.Simulate(workingBeatmap, beatmap, mods);
|
||||
attributes.LegacyAccuracyScore = sv1Processor.AccuracyScore;
|
||||
attributes.LegacyComboScore = sv1Processor.ComboScore;
|
||||
attributes.LegacyBonusScoreRatio = sv1Processor.BonusScoreRatio;
|
||||
ManiaLegacyScoreSimulator sv1Simulator = new ManiaLegacyScoreSimulator();
|
||||
sv1Simulator.Simulate(workingBeatmap, beatmap, mods);
|
||||
attributes.LegacyAccuracyScore = sv1Simulator.AccuracyScore;
|
||||
attributes.LegacyComboScore = sv1Simulator.ComboScore;
|
||||
attributes.LegacyBonusScoreRatio = sv1Simulator.BonusScoreRatio;
|
||||
}
|
||||
|
||||
return attributes;
|
||||
|
@ -10,7 +10,7 @@ using osu.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Mania.Difficulty
|
||||
{
|
||||
internal class ManiaLegacyScoreProcessor : ILegacyScoreProcessor
|
||||
internal class ManiaLegacyScoreSimulator : ILegacyScoreSimulator
|
||||
{
|
||||
public int AccuracyScore => 0;
|
||||
public int ComboScore { get; private set; }
|
@ -302,7 +302,7 @@ namespace osu.Game.Rulesets.Mania
|
||||
|
||||
public int LegacyID => 3;
|
||||
|
||||
public ILegacyScoreProcessor CreateLegacyScoreProcessor() => new ManiaLegacyScoreProcessor();
|
||||
public ILegacyScoreSimulator CreateLegacyScoreSimulator() => new ManiaLegacyScoreSimulator();
|
||||
|
||||
public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new ManiaReplayFrame();
|
||||
|
||||
|
@ -111,11 +111,11 @@ namespace osu.Game.Rulesets.Osu.Difficulty
|
||||
|
||||
if (ComputeLegacyScoringValues)
|
||||
{
|
||||
OsuLegacyScoreProcessor sv1Processor = new OsuLegacyScoreProcessor();
|
||||
sv1Processor.Simulate(workingBeatmap, beatmap, mods);
|
||||
attributes.LegacyAccuracyScore = sv1Processor.AccuracyScore;
|
||||
attributes.LegacyComboScore = sv1Processor.ComboScore;
|
||||
attributes.LegacyBonusScoreRatio = sv1Processor.BonusScoreRatio;
|
||||
OsuLegacyScoreSimulator sv1Simulator = new OsuLegacyScoreSimulator();
|
||||
sv1Simulator.Simulate(workingBeatmap, beatmap, mods);
|
||||
attributes.LegacyAccuracyScore = sv1Simulator.AccuracyScore;
|
||||
attributes.LegacyComboScore = sv1Simulator.ComboScore;
|
||||
attributes.LegacyBonusScoreRatio = sv1Simulator.BonusScoreRatio;
|
||||
}
|
||||
|
||||
return attributes;
|
||||
|
@ -14,7 +14,7 @@ using osu.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Difficulty
|
||||
{
|
||||
internal class OsuLegacyScoreProcessor : ILegacyScoreProcessor
|
||||
internal class OsuLegacyScoreSimulator : ILegacyScoreSimulator
|
||||
{
|
||||
public int AccuracyScore { get; private set; }
|
||||
|
@ -253,7 +253,7 @@ namespace osu.Game.Rulesets.Osu
|
||||
|
||||
public int LegacyID => 0;
|
||||
|
||||
public ILegacyScoreProcessor CreateLegacyScoreProcessor() => new OsuLegacyScoreProcessor();
|
||||
public ILegacyScoreSimulator CreateLegacyScoreSimulator() => new OsuLegacyScoreSimulator();
|
||||
|
||||
public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new OsuReplayFrame();
|
||||
|
||||
|
@ -101,11 +101,11 @@ namespace osu.Game.Rulesets.Taiko.Difficulty
|
||||
|
||||
if (ComputeLegacyScoringValues)
|
||||
{
|
||||
TaikoLegacyScoreProcessor sv1Processor = new TaikoLegacyScoreProcessor();
|
||||
sv1Processor.Simulate(workingBeatmap, beatmap, mods);
|
||||
attributes.LegacyAccuracyScore = sv1Processor.AccuracyScore;
|
||||
attributes.LegacyComboScore = sv1Processor.ComboScore;
|
||||
attributes.LegacyBonusScoreRatio = sv1Processor.BonusScoreRatio;
|
||||
TaikoLegacyScoreSimulator sv1Simulator = new TaikoLegacyScoreSimulator();
|
||||
sv1Simulator.Simulate(workingBeatmap, beatmap, mods);
|
||||
attributes.LegacyAccuracyScore = sv1Simulator.AccuracyScore;
|
||||
attributes.LegacyComboScore = sv1Simulator.ComboScore;
|
||||
attributes.LegacyBonusScoreRatio = sv1Simulator.BonusScoreRatio;
|
||||
}
|
||||
|
||||
return attributes;
|
||||
|
@ -14,7 +14,7 @@ using osu.Game.Rulesets.Taiko.Objects;
|
||||
|
||||
namespace osu.Game.Rulesets.Taiko.Difficulty
|
||||
{
|
||||
internal class TaikoLegacyScoreProcessor : ILegacyScoreProcessor
|
||||
internal class TaikoLegacyScoreSimulator : ILegacyScoreSimulator
|
||||
{
|
||||
public int AccuracyScore { get; private set; }
|
||||
|
@ -197,7 +197,7 @@ namespace osu.Game.Rulesets.Taiko
|
||||
|
||||
public int LegacyID => 1;
|
||||
|
||||
public ILegacyScoreProcessor CreateLegacyScoreProcessor() => new TaikoLegacyScoreProcessor();
|
||||
public ILegacyScoreSimulator CreateLegacyScoreSimulator() => new TaikoLegacyScoreSimulator();
|
||||
|
||||
public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new TaikoReplayFrame();
|
||||
|
||||
|
@ -205,15 +205,15 @@ namespace osu.Game.Database
|
||||
if (ruleset is not ILegacyRuleset legacyRuleset)
|
||||
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
|
||||
{
|
||||
LegacyAccuracyScore = sv1Processor.AccuracyScore,
|
||||
LegacyComboScore = sv1Processor.ComboScore,
|
||||
LegacyBonusScoreRatio = sv1Processor.BonusScoreRatio
|
||||
LegacyAccuracyScore = sv1Simulator.AccuracyScore,
|
||||
LegacyComboScore = sv1Simulator.ComboScore,
|
||||
LegacyBonusScoreRatio = sv1Simulator.BonusScoreRatio
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,6 @@ namespace osu.Game.Rulesets
|
||||
/// </summary>
|
||||
int LegacyID { get; }
|
||||
|
||||
ILegacyScoreProcessor CreateLegacyScoreProcessor();
|
||||
ILegacyScoreSimulator CreateLegacyScoreSimulator();
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,10 @@ using osu.Game.Rulesets.Mods;
|
||||
|
||||
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>
|
||||
/// The accuracy portion of the legacy (ScoreV1) total score.
|
Loading…
Reference in New Issue
Block a user