mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:27:29 +08:00
Merge pull request #7256 from peppy/remove-ruleset-ctor-param
Remove RulesetInfo parameter from Ruleset constructor
This commit is contained in:
commit
51a01c7006
@ -137,10 +137,5 @@ namespace osu.Game.Rulesets.Catch
|
||||
public override int? LegacyID => 2;
|
||||
|
||||
public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new CatchReplayFrame();
|
||||
|
||||
public CatchRuleset(RulesetInfo rulesetInfo = null)
|
||||
: base(rulesetInfo)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -186,11 +186,6 @@ namespace osu.Game.Rulesets.Mania
|
||||
|
||||
public override RulesetSettingsSubsection CreateSettings() => new ManiaSettingsSubsection(this);
|
||||
|
||||
public ManiaRuleset(RulesetInfo rulesetInfo = null)
|
||||
: base(rulesetInfo)
|
||||
{
|
||||
}
|
||||
|
||||
public override IEnumerable<int> AvailableVariants
|
||||
{
|
||||
get
|
||||
|
@ -183,10 +183,5 @@ namespace osu.Game.Rulesets.Osu
|
||||
public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new OsuReplayFrame();
|
||||
|
||||
public override IRulesetConfigManager CreateConfig(SettingsStore settings) => new OsuRulesetConfigManager(settings, RulesetInfo);
|
||||
|
||||
public OsuRuleset(RulesetInfo rulesetInfo = null)
|
||||
: base(rulesetInfo)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -136,10 +136,5 @@ namespace osu.Game.Rulesets.Taiko
|
||||
public override int? LegacyID => 1;
|
||||
|
||||
public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new TaikoReplayFrame();
|
||||
|
||||
public TaikoRuleset(RulesetInfo rulesetInfo = null)
|
||||
: base(rulesetInfo)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -194,11 +194,6 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
|
||||
private class TestScrollingRuleset : Ruleset
|
||||
{
|
||||
public TestScrollingRuleset(RulesetInfo rulesetInfo = null)
|
||||
: base(rulesetInfo)
|
||||
{
|
||||
}
|
||||
|
||||
public override IEnumerable<Mod> GetModsFor(ModType type) => throw new NotImplementedException();
|
||||
|
||||
public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList<Mod> mods = null) => new TestDrawableScrollingRuleset(this, beatmap, mods);
|
||||
|
@ -51,7 +51,7 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
private class DummyRulesetInfo : RulesetInfo
|
||||
{
|
||||
public override Ruleset CreateInstance() => new DummyRuleset(this);
|
||||
public override Ruleset CreateInstance() => new DummyRuleset();
|
||||
|
||||
private class DummyRuleset : Ruleset
|
||||
{
|
||||
@ -70,11 +70,6 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
public override string ShortName => "dummy";
|
||||
|
||||
public DummyRuleset(RulesetInfo rulesetInfo = null)
|
||||
: base(rulesetInfo)
|
||||
{
|
||||
}
|
||||
|
||||
private class DummyBeatmapConverter : IBeatmapConverter
|
||||
{
|
||||
public event Action<HitObject, IEnumerable<HitObject>> ObjectConverted;
|
||||
|
@ -49,9 +49,9 @@ namespace osu.Game.Rulesets
|
||||
|
||||
public virtual ISkin CreateLegacySkinProvider(ISkinSource source) => null;
|
||||
|
||||
protected Ruleset(RulesetInfo rulesetInfo = null)
|
||||
protected Ruleset()
|
||||
{
|
||||
RulesetInfo = rulesetInfo ?? createRulesetInfo();
|
||||
RulesetInfo = createRulesetInfo();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -24,7 +24,7 @@ namespace osu.Game.Rulesets
|
||||
{
|
||||
if (!Available) return null;
|
||||
|
||||
return (Ruleset)Activator.CreateInstance(Type.GetType(InstantiationInfo), this);
|
||||
return (Ruleset)Activator.CreateInstance(Type.GetType(InstantiationInfo));
|
||||
}
|
||||
|
||||
public bool Equals(RulesetInfo other) => other != null && ID == other.ID && Available == other.Available && Name == other.Name && InstantiationInfo == other.InstantiationInfo;
|
||||
|
@ -56,7 +56,7 @@ namespace osu.Game.Rulesets
|
||||
{
|
||||
var context = usage.Context;
|
||||
|
||||
var instances = loadedAssemblies.Values.Select(r => (Ruleset)Activator.CreateInstance(r, (RulesetInfo)null)).ToList();
|
||||
var instances = loadedAssemblies.Values.Select(r => (Ruleset)Activator.CreateInstance(r)).ToList();
|
||||
|
||||
//add all legacy modes in correct order
|
||||
foreach (var r in instances.Where(r => r.LegacyID != null).OrderBy(r => r.LegacyID))
|
||||
@ -87,7 +87,7 @@ namespace osu.Game.Rulesets
|
||||
// this allows for debug builds to successfully load rulesets (even though debug rulesets have a 0.0.0 version).
|
||||
asm.Version = null;
|
||||
return Assembly.Load(asm);
|
||||
}, null), (RulesetInfo)null)).RulesetInfo;
|
||||
}, null))).RulesetInfo;
|
||||
|
||||
r.Name = instanceInfo.Name;
|
||||
r.ShortName = instanceInfo.ShortName;
|
||||
|
Loading…
Reference in New Issue
Block a user