mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Privatise the OsuGame beatmap, add local beatmap to OsuTestCase
This commit is contained in:
@ -19,8 +19,6 @@ namespace osu.Game.Tests.Visual
|
||||
|
||||
protected Player Player;
|
||||
|
||||
private TestWorkingBeatmap working;
|
||||
|
||||
protected TestCasePlayer(Ruleset ruleset)
|
||||
{
|
||||
this.ruleset = ruleset;
|
||||
@ -65,13 +63,13 @@ namespace osu.Game.Tests.Visual
|
||||
{
|
||||
var beatmap = CreateBeatmap(r);
|
||||
|
||||
working = new TestWorkingBeatmap(beatmap);
|
||||
working.Mods.Value = new[] { r.GetAllMods().First(m => m is ModNoFail) };
|
||||
Beatmap.Value = new TestWorkingBeatmap(beatmap);
|
||||
Beatmap.Value.Mods.Value = new[] { r.GetAllMods().First(m => m is ModNoFail) };
|
||||
|
||||
if (Player != null)
|
||||
Remove(Player);
|
||||
|
||||
var player = CreatePlayer(working, r);
|
||||
var player = CreatePlayer(Beatmap, r);
|
||||
|
||||
LoadComponentAsync(player, LoadScreen);
|
||||
|
||||
@ -82,14 +80,12 @@ namespace osu.Game.Tests.Visual
|
||||
{
|
||||
base.Update();
|
||||
|
||||
if (working != null)
|
||||
// note that this will override any mod rate application
|
||||
working.Track.Rate = Clock.Rate;
|
||||
// note that this will override any mod rate application
|
||||
Beatmap.Value.Track.Rate = Clock.Rate;
|
||||
}
|
||||
|
||||
protected virtual Player CreatePlayer(WorkingBeatmap beatmap, Ruleset ruleset) => new Player
|
||||
{
|
||||
InitialBeatmap = beatmap,
|
||||
AllowPause = false,
|
||||
AllowLeadIn = false,
|
||||
AllowResults = false,
|
||||
|
Reference in New Issue
Block a user