mirror of
https://github.com/ppy/osu.git
synced 2025-01-06 21:12:55 +08:00
Move Ruleset method to ILegacyRuleset interface
This commit is contained in:
parent
6822871dab
commit
c6ad184d94
@ -202,6 +202,8 @@ namespace osu.Game.Rulesets.Catch
|
||||
|
||||
public int LegacyID => 2;
|
||||
|
||||
public ILegacyScoreProcessor CreateLegacyScoreProcessor() => new CatchLegacyScoreProcessor();
|
||||
|
||||
public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new CatchReplayFrame();
|
||||
|
||||
public override HitObjectComposer CreateHitObjectComposer() => new CatchHitObjectComposer(this);
|
||||
|
@ -302,6 +302,8 @@ namespace osu.Game.Rulesets.Mania
|
||||
|
||||
public int LegacyID => 3;
|
||||
|
||||
public ILegacyScoreProcessor CreateLegacyScoreProcessor() => new ManiaLegacyScoreProcessor();
|
||||
|
||||
public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new ManiaReplayFrame();
|
||||
|
||||
public override IRulesetConfigManager CreateConfig(SettingsStore? settings) => new ManiaRulesetConfigManager(settings, RulesetInfo);
|
||||
|
@ -253,6 +253,8 @@ namespace osu.Game.Rulesets.Osu
|
||||
|
||||
public int LegacyID => 0;
|
||||
|
||||
public ILegacyScoreProcessor CreateLegacyScoreProcessor() => new OsuLegacyScoreProcessor();
|
||||
|
||||
public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new OsuReplayFrame();
|
||||
|
||||
public override IRulesetConfigManager CreateConfig(SettingsStore? settings) => new OsuRulesetConfigManager(settings, RulesetInfo);
|
||||
@ -322,7 +324,5 @@ namespace osu.Game.Rulesets.Osu
|
||||
}
|
||||
|
||||
public override RulesetSetupSection CreateEditorSetupSection() => new OsuSetupSection();
|
||||
|
||||
public override ILegacyScoreProcessor CreateLegacyScoreProcessor() => new OsuLegacyScoreProcessor();
|
||||
}
|
||||
}
|
||||
|
@ -197,6 +197,8 @@ namespace osu.Game.Rulesets.Taiko
|
||||
|
||||
public int LegacyID => 1;
|
||||
|
||||
public ILegacyScoreProcessor CreateLegacyScoreProcessor() => new TaikoLegacyScoreProcessor();
|
||||
|
||||
public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new TaikoReplayFrame();
|
||||
|
||||
public override IRulesetConfigManager CreateConfig(SettingsStore? settings) => new TaikoRulesetConfigManager(settings, RulesetInfo);
|
||||
|
@ -6,6 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Difficulty;
|
||||
using osu.Game.Rulesets.Judgements;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
@ -201,7 +202,10 @@ namespace osu.Game.Database
|
||||
var beatmap = beatmaps.GetWorkingBeatmap(score.BeatmapInfo);
|
||||
var ruleset = score.Ruleset.CreateInstance();
|
||||
|
||||
var sv1Processor = ruleset.CreateLegacyScoreProcessor();
|
||||
if (ruleset is not ILegacyRuleset legacyRuleset)
|
||||
return score.TotalScore;
|
||||
|
||||
var sv1Processor = legacyRuleset.CreateLegacyScoreProcessor();
|
||||
if (sv1Processor == null)
|
||||
return score.TotalScore;
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets
|
||||
{
|
||||
public interface ILegacyRuleset
|
||||
@ -11,5 +13,7 @@ namespace osu.Game.Rulesets
|
||||
/// Identifies the server-side ID of a legacy ruleset.
|
||||
/// </summary>
|
||||
int LegacyID { get; }
|
||||
|
||||
ILegacyScoreProcessor CreateLegacyScoreProcessor();
|
||||
}
|
||||
}
|
||||
|
@ -380,7 +380,5 @@ namespace osu.Game.Rulesets
|
||||
/// Can be overridden to add a ruleset-specific section to the editor beatmap setup screen.
|
||||
/// </summary>
|
||||
public virtual RulesetSetupSection? CreateEditorSetupSection() => null;
|
||||
|
||||
public virtual ILegacyScoreProcessor? CreateLegacyScoreProcessor() => null;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user