2020-04-11 12:14:34 +08: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.
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
using osu.Game.Beatmaps.ControlPoints;
|
|
|
|
using osu.Game.Rulesets.Taiko.Objects;
|
|
|
|
using osu.Game.Rulesets.Taiko.Objects.Drawables;
|
2020-04-11 13:20:09 +08:00
|
|
|
using osu.Game.Rulesets.Taiko.Skinning;
|
2020-04-11 12:14:34 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Taiko.Tests
|
|
|
|
{
|
|
|
|
[TestFixture]
|
|
|
|
public class TestSceneDrawableHit : TaikoSkinnableTestScene
|
|
|
|
{
|
|
|
|
public override IReadOnlyList<Type> RequiredTypes => base.RequiredTypes.Concat(new[]
|
|
|
|
{
|
|
|
|
typeof(DrawableHit),
|
|
|
|
typeof(DrawableCentreHit),
|
|
|
|
typeof(DrawableRimHit),
|
2020-04-11 13:20:09 +08:00
|
|
|
typeof(LegacyHit),
|
2020-04-11 12:14:34 +08:00
|
|
|
}).ToList();
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load()
|
|
|
|
{
|
|
|
|
AddStep("Centre hit", () => SetContents(() => new DrawableCentreHit(createHitAtCurrentTime())
|
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
}));
|
2020-04-11 13:43:57 +08:00
|
|
|
|
|
|
|
AddStep("Centre hit (strong)", () => SetContents(() => new DrawableCentreHit(createHitAtCurrentTime(true))
|
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
}));
|
|
|
|
|
2020-04-11 12:14:34 +08:00
|
|
|
AddStep("Rim hit", () => SetContents(() => new DrawableRimHit(createHitAtCurrentTime())
|
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
}));
|
2020-04-11 13:43:57 +08:00
|
|
|
|
|
|
|
AddStep("Rim hit (strong)", () => SetContents(() => new DrawableRimHit(createHitAtCurrentTime(true))
|
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
}));
|
2020-04-11 12:14:34 +08:00
|
|
|
}
|
|
|
|
|
2020-04-11 13:43:57 +08:00
|
|
|
private Hit createHitAtCurrentTime(bool strong = false)
|
2020-04-11 12:14:34 +08:00
|
|
|
{
|
|
|
|
var hit = new Hit
|
|
|
|
{
|
2020-04-11 13:43:57 +08:00
|
|
|
IsStrong = strong,
|
2020-04-11 12:14:34 +08:00
|
|
|
StartTime = Time.Current + 3000,
|
|
|
|
};
|
|
|
|
|
|
|
|
hit.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
|
|
|
|
|
|
|
|
return hit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|