mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Remove subclassing of RulesetInfo
This commit is contained in:
@ -55,7 +55,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
new Drawable[]
|
new Drawable[]
|
||||||
{
|
{
|
||||||
recordingManager = new TestRulesetInputManager(new TestSceneModSettings.TestRulesetInfo(), 0, SimultaneousBindingMode.Unique)
|
recordingManager = new TestRulesetInputManager(TestSceneModSettings.CreateTestRulesetInfo(), 0, SimultaneousBindingMode.Unique)
|
||||||
{
|
{
|
||||||
Recorder = recorder = new TestReplayRecorder(new Score
|
Recorder = recorder = new TestReplayRecorder(new Score
|
||||||
{
|
{
|
||||||
@ -89,7 +89,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
},
|
},
|
||||||
new Drawable[]
|
new Drawable[]
|
||||||
{
|
{
|
||||||
playbackManager = new TestRulesetInputManager(new TestSceneModSettings.TestRulesetInfo(), 0, SimultaneousBindingMode.Unique)
|
playbackManager = new TestRulesetInputManager(TestSceneModSettings.CreateTestRulesetInfo(), 0, SimultaneousBindingMode.Unique)
|
||||||
{
|
{
|
||||||
ReplayInputHandler = new TestFramedReplayInputHandler(replay)
|
ReplayInputHandler = new TestFramedReplayInputHandler(replay)
|
||||||
{
|
{
|
||||||
|
@ -46,7 +46,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
new Drawable[]
|
new Drawable[]
|
||||||
{
|
{
|
||||||
recordingManager = new TestRulesetInputManager(new TestSceneModSettings.TestRulesetInfo(), 0, SimultaneousBindingMode.Unique)
|
recordingManager = new TestRulesetInputManager(TestSceneModSettings.CreateTestRulesetInfo(), 0, SimultaneousBindingMode.Unique)
|
||||||
{
|
{
|
||||||
Recorder = new TestReplayRecorder(new Score
|
Recorder = new TestReplayRecorder(new Score
|
||||||
{
|
{
|
||||||
@ -80,7 +80,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
},
|
},
|
||||||
new Drawable[]
|
new Drawable[]
|
||||||
{
|
{
|
||||||
playbackManager = new TestRulesetInputManager(new TestSceneModSettings.TestRulesetInfo(), 0, SimultaneousBindingMode.Unique)
|
playbackManager = new TestRulesetInputManager(TestSceneModSettings.CreateTestRulesetInfo(), 0, SimultaneousBindingMode.Unique)
|
||||||
{
|
{
|
||||||
ReplayInputHandler = new TestFramedReplayInputHandler(replay)
|
ReplayInputHandler = new TestFramedReplayInputHandler(replay)
|
||||||
{
|
{
|
||||||
|
@ -109,7 +109,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
new Drawable[]
|
new Drawable[]
|
||||||
{
|
{
|
||||||
recordingManager = new TestRulesetInputManager(new TestSceneModSettings.TestRulesetInfo(), 0, SimultaneousBindingMode.Unique)
|
recordingManager = new TestRulesetInputManager(TestSceneModSettings.CreateTestRulesetInfo(), 0, SimultaneousBindingMode.Unique)
|
||||||
{
|
{
|
||||||
Recorder = recorder = new TestReplayRecorder
|
Recorder = recorder = new TestReplayRecorder
|
||||||
{
|
{
|
||||||
@ -139,7 +139,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
},
|
},
|
||||||
new Drawable[]
|
new Drawable[]
|
||||||
{
|
{
|
||||||
playbackManager = new TestRulesetInputManager(new TestSceneModSettings.TestRulesetInfo(), 0, SimultaneousBindingMode.Unique)
|
playbackManager = new TestRulesetInputManager(TestSceneModSettings.CreateTestRulesetInfo(), 0, SimultaneousBindingMode.Unique)
|
||||||
{
|
{
|
||||||
Clock = new FramedClock(manualClock),
|
Clock = new FramedClock(manualClock),
|
||||||
ReplayInputHandler = replayHandler = new TestFramedReplayInputHandler(replay)
|
ReplayInputHandler = replayHandler = new TestFramedReplayInputHandler(replay)
|
||||||
|
@ -35,7 +35,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
public void SetUp() => Schedule(() =>
|
public void SetUp() => Schedule(() =>
|
||||||
{
|
{
|
||||||
SelectedMods.Value = Array.Empty<Mod>();
|
SelectedMods.Value = Array.Empty<Mod>();
|
||||||
Ruleset.Value = new TestRulesetInfo();
|
Ruleset.Value = CreateTestRulesetInfo();
|
||||||
});
|
});
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -170,14 +170,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
ModSettingsContainer.Parent.Width = newWidth;
|
ModSettingsContainer.Parent.Width = newWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TestRulesetInfo : RulesetInfo
|
public static RulesetInfo CreateTestRulesetInfo() => new TestCustomisableModRuleset().RulesetInfo;
|
||||||
{
|
|
||||||
public override Ruleset CreateInstance() => new TestCustomisableModRuleset();
|
|
||||||
|
|
||||||
public TestRulesetInfo()
|
|
||||||
{
|
|
||||||
Available = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class TestCustomisableModRuleset : Ruleset
|
public class TestCustomisableModRuleset : Ruleset
|
||||||
{
|
{
|
||||||
@ -204,7 +197,6 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
public override string Description { get; } = "test";
|
public override string Description { get; } = "test";
|
||||||
public override string ShortName { get; } = "tst";
|
public override string ShortName { get; } = "tst";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private class TestModCustomisable1 : TestModCustomisable
|
private class TestModCustomisable1 : TestModCustomisable
|
||||||
{
|
{
|
||||||
|
@ -38,7 +38,7 @@ namespace osu.Game.Beatmaps
|
|||||||
CircleSize = 0,
|
CircleSize = 0,
|
||||||
OverallDifficulty = 0,
|
OverallDifficulty = 0,
|
||||||
},
|
},
|
||||||
Ruleset = new DummyRulesetInfo()
|
Ruleset = new DummyRuleset().RulesetInfo
|
||||||
}, audio)
|
}, audio)
|
||||||
{
|
{
|
||||||
this.textures = textures;
|
this.textures = textures;
|
||||||
@ -54,10 +54,6 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
public override Stream GetStream(string storagePath) => null;
|
public override Stream GetStream(string storagePath) => null;
|
||||||
|
|
||||||
private class DummyRulesetInfo : RulesetInfo
|
|
||||||
{
|
|
||||||
public override Ruleset CreateInstance() => new DummyRuleset();
|
|
||||||
|
|
||||||
private class DummyRuleset : Ruleset
|
private class DummyRuleset : Ruleset
|
||||||
{
|
{
|
||||||
public override IEnumerable<Mod> GetModsFor(ModType type) => Array.Empty<Mod>();
|
public override IEnumerable<Mod> GetModsFor(ModType type) => Array.Empty<Mod>();
|
||||||
@ -93,5 +89,4 @@ namespace osu.Game.Beatmaps
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user