mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 21:52:55 +08:00
Add test for dynamically changing catch fruits
This commit is contained in:
parent
e36bb7631d
commit
de471a7e84
@ -30,13 +30,13 @@ namespace osu.Game.Rulesets.Catch.Tests
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Drawable createDrawableFruit(FruitVisualRepresentation rep, bool hyperdash = false) =>
|
private Drawable createDrawableFruit(FruitVisualRepresentation rep, bool hyperdash = false) =>
|
||||||
setProperties(new TestDrawableFruit(new Fruit(), rep), hyperdash);
|
SetProperties(new TestDrawableFruit(new Fruit(), rep), hyperdash);
|
||||||
|
|
||||||
private Drawable createDrawableDroplet(bool hyperdash = false) => setProperties(new DrawableDroplet(new Droplet()), hyperdash);
|
private Drawable createDrawableDroplet(bool hyperdash = false) => SetProperties(new DrawableDroplet(new Droplet()), hyperdash);
|
||||||
|
|
||||||
private Drawable createDrawableTinyDroplet() => setProperties(new DrawableTinyDroplet(new TinyDroplet()));
|
private Drawable createDrawableTinyDroplet() => SetProperties(new DrawableTinyDroplet(new TinyDroplet()));
|
||||||
|
|
||||||
private DrawableCatchHitObject setProperties(DrawableCatchHitObject d, bool hyperdash = false)
|
protected virtual DrawableCatchHitObject SetProperties(DrawableCatchHitObject d, bool hyperdash = false)
|
||||||
{
|
{
|
||||||
var hitObject = d.HitObject;
|
var hitObject = d.HitObject;
|
||||||
hitObject.StartTime = 1000000000000;
|
hitObject.StartTime = 1000000000000;
|
||||||
|
32
osu.Game.Rulesets.Catch.Tests/TestSceneFruitVisualChange.cs
Normal file
32
osu.Game.Rulesets.Catch.Tests/TestSceneFruitVisualChange.cs
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Game.Rulesets.Catch.Objects;
|
||||||
|
using osu.Game.Rulesets.Catch.Objects.Drawables;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Catch.Tests
|
||||||
|
{
|
||||||
|
public class TestSceneFruitVisualChange : TestSceneFruitObjects
|
||||||
|
{
|
||||||
|
private readonly Bindable<int> indexInBeatmap = new Bindable<int>();
|
||||||
|
private readonly Bindable<bool> hyperDash = new Bindable<bool>();
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
AddStep("fruit changes visual and hyper", () => SetContents(() => SetProperties(new DrawableFruit(new Fruit
|
||||||
|
{
|
||||||
|
IndexInBeatmapBindable = { BindTarget = indexInBeatmap },
|
||||||
|
HyperDashBindable = { BindTarget = hyperDash },
|
||||||
|
}))));
|
||||||
|
|
||||||
|
AddStep("droplet changes hyper", () => SetContents(() => SetProperties(new DrawableDroplet(new Droplet
|
||||||
|
{
|
||||||
|
HyperDashBindable = { BindTarget = hyperDash },
|
||||||
|
}))));
|
||||||
|
|
||||||
|
Scheduler.AddDelayed(() => indexInBeatmap.Value++, 250, true);
|
||||||
|
Scheduler.AddDelayed(() => hyperDash.Value = !hyperDash.Value, 1000, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user