mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 02:03:22 +08:00
Add ability to test without nofail enabled
This commit is contained in:
parent
8df47bc23e
commit
a81461ba12
@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@ -36,12 +36,16 @@ namespace osu.Game.Tests.Visual
|
|||||||
|
|
||||||
protected virtual IBeatmap CreateBeatmap(Ruleset ruleset) => new TestBeatmap(ruleset.RulesetInfo);
|
protected virtual IBeatmap CreateBeatmap(Ruleset ruleset) => new TestBeatmap(ruleset.RulesetInfo);
|
||||||
|
|
||||||
|
protected virtual bool AllowFail => false;
|
||||||
|
|
||||||
private void loadPlayer()
|
private void loadPlayer()
|
||||||
{
|
{
|
||||||
var beatmap = CreateBeatmap(ruleset);
|
var beatmap = CreateBeatmap(ruleset);
|
||||||
|
|
||||||
Beatmap.Value = new TestWorkingBeatmap(beatmap, Clock);
|
Beatmap.Value = new TestWorkingBeatmap(beatmap, Clock);
|
||||||
Beatmap.Value.Mods.Value = new[] { ruleset.GetAllMods().First(m => m is ModNoFail) };
|
|
||||||
|
if (!AllowFail)
|
||||||
|
Beatmap.Value.Mods.Value = new[] { ruleset.GetAllMods().First(m => m is ModNoFail) };
|
||||||
|
|
||||||
LoadComponentAsync(Player = CreatePlayer(ruleset), p =>
|
LoadComponentAsync(Player = CreatePlayer(ruleset), p =>
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user