Privatise the OsuGame beatmap, add local beatmap to OsuTestCase

This commit is contained in:
smoogipoo
2018-05-23 17:37:39 +09:00
parent 6c0c932c48
commit 8004b8af4d
51 changed files with 279 additions and 277 deletions

View File

@ -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,