1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 12:53:11 +08:00

Add back settable RulesetID for now

This commit is contained in:
Dean Herbert 2021-12-21 16:30:34 +09:00
parent 2a980cc474
commit dcd69e852e
2 changed files with 15 additions and 4 deletions

View File

@ -140,8 +140,21 @@ namespace osu.Game.Beatmaps
#region Compatibility properties
private int rulesetID;
[Ignored]
public int RulesetID => Ruleset.OnlineID;
public int RulesetID
{
// ReSharper disable once ConstantConditionalAccessQualifier
get => Ruleset?.OnlineID ?? rulesetID;
set
{
if (Ruleset != null)
throw new InvalidOperationException($"Cannot set a {nameof(RulesetID)} when {nameof(Ruleset)} is non-null");
rulesetID = value;
}
}
[Ignored]
public Guid BeatmapSetInfoID => BeatmapSet?.ID ?? Guid.Empty;

View File

@ -11,7 +11,6 @@ using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Beatmaps.Legacy;
using osu.Game.Beatmaps.Timing;
using osu.Game.IO;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Objects.Legacy;
namespace osu.Game.Beatmaps.Formats
@ -142,8 +141,7 @@ namespace osu.Game.Beatmaps.Formats
break;
case @"Mode":
// TODO: ha ha ha.
beatmap.BeatmapInfo.Ruleset = new RulesetInfo(Parsing.ParseInt(pair.Value), "some ruleset", "wangs", true /* probably not */);
beatmap.BeatmapInfo.RulesetID = Parsing.ParseInt(pair.Value);
switch (beatmap.BeatmapInfo.RulesetID)
{