2020-03-31 06:29:25 +00:00
|
|
|
// 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.
|
|
|
|
|
2022-06-17 07:37:17 +00:00
|
|
|
#nullable disable
|
|
|
|
|
2020-11-13 13:31:24 +00:00
|
|
|
using System.Collections.Generic;
|
2020-04-02 08:09:08 +00:00
|
|
|
using System.Linq;
|
2020-10-02 09:18:14 +00:00
|
|
|
using NUnit.Framework;
|
2020-04-02 08:09:08 +00:00
|
|
|
using osu.Framework.Bindables;
|
|
|
|
using osu.Framework.Testing;
|
2020-03-31 06:29:25 +00:00
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
using osu.Game.Beatmaps.ControlPoints;
|
|
|
|
using osu.Game.Rulesets.Mania.Objects;
|
|
|
|
using osu.Game.Rulesets.Mania.Objects.Drawables;
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Mania.Tests.Skinning
|
|
|
|
{
|
|
|
|
public class TestSceneHoldNote : ManiaHitObjectTestScene
|
|
|
|
{
|
2020-10-02 09:18:14 +00:00
|
|
|
[Test]
|
|
|
|
public void TestHoldNote()
|
2020-04-02 08:09:08 +00:00
|
|
|
{
|
|
|
|
AddToggleStep("toggle hitting", v =>
|
|
|
|
{
|
|
|
|
foreach (var holdNote in CreatedDrawables.SelectMany(d => d.ChildrenOfType<DrawableHoldNote>()))
|
|
|
|
{
|
|
|
|
((Bindable<bool>)holdNote.IsHitting).Value = v;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2020-11-13 13:31:24 +00:00
|
|
|
[Test]
|
|
|
|
public void TestFadeOnMiss()
|
|
|
|
{
|
|
|
|
AddStep("miss tick", () =>
|
|
|
|
{
|
|
|
|
foreach (var holdNote in holdNotes)
|
|
|
|
holdNote.ChildrenOfType<DrawableHoldNoteHead>().First().MissForcefully();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
private IEnumerable<DrawableHoldNote> holdNotes => CreatedDrawables.SelectMany(d => d.ChildrenOfType<DrawableHoldNote>());
|
|
|
|
|
2020-03-31 06:29:25 +00:00
|
|
|
protected override DrawableManiaHitObject CreateHitObject()
|
|
|
|
{
|
|
|
|
var note = new HoldNote { Duration = 1000 };
|
|
|
|
note.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
|
|
|
|
|
2020-04-02 07:36:57 +00:00
|
|
|
return new DrawableHoldNote(note);
|
2020-03-31 06:29:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|