mirror of
https://github.com/osukey/osukey.git
synced 2025-05-16 19:17:18 +09:00
Add autoplay helper property
This commit is contained in:
parent
d780426808
commit
cad68bb82f
@ -3,6 +3,7 @@
|
||||
|
||||
using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Rulesets;
|
||||
@ -40,6 +41,8 @@ namespace osu.Game.Tests.Visual
|
||||
|
||||
protected virtual bool AllowFail => false;
|
||||
|
||||
protected virtual bool Autoplay => false;
|
||||
|
||||
private void loadPlayer()
|
||||
{
|
||||
var beatmap = CreateBeatmap(ruleset.RulesetInfo);
|
||||
@ -53,6 +56,16 @@ namespace osu.Game.Tests.Visual
|
||||
LoadScreen(Player);
|
||||
}
|
||||
|
||||
protected virtual Player CreatePlayer(Ruleset ruleset) => new TestPlayer(false, false);
|
||||
protected virtual Player CreatePlayer(Ruleset ruleset)
|
||||
{
|
||||
if (Autoplay)
|
||||
{
|
||||
var mod = ruleset.GetAutoplayMod();
|
||||
if (mod != null)
|
||||
Mods.Value = Mods.Value.Concat(mod.Yield()).ToArray();
|
||||
}
|
||||
|
||||
return new TestPlayer(false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user