2018-11-12 18:41:06 +08:00
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
using osu.Framework.Timing;
|
|
|
|
using osu.Game.Rulesets.Mania.Edit;
|
|
|
|
using osu.Game.Rulesets.Mania.Objects.Drawables;
|
|
|
|
using osu.Game.Rulesets.Mania.UI;
|
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
|
|
|
using osu.Game.Rulesets.UI.Scrolling;
|
|
|
|
using osu.Game.Tests.Visual;
|
2018-11-26 09:44:48 +08:00
|
|
|
using osuTK;
|
|
|
|
using osuTK.Graphics;
|
2018-11-12 18:41:06 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Mania.Tests
|
|
|
|
{
|
|
|
|
[Cached(Type = typeof(IManiaHitObjectComposer))]
|
|
|
|
public abstract class ManiaPlacementBlueprintTestCase : PlacementBlueprintTestCase, IManiaHitObjectComposer
|
|
|
|
{
|
|
|
|
private readonly Column column;
|
|
|
|
|
|
|
|
protected ManiaPlacementBlueprintTestCase()
|
|
|
|
{
|
|
|
|
Add(column = new Column(0)
|
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
AccentColour = Color4.OrangeRed,
|
|
|
|
Clock = new FramedClock(new StopwatchClock()), // No scroll
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
|
|
|
|
{
|
|
|
|
var dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
|
|
|
|
|
|
|
|
dependencies.CacheAs(((ScrollingTestContainer)HitObjectContainer).ScrollingInfo);
|
|
|
|
|
|
|
|
return dependencies;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override Container CreateHitObjectContainer() => new ScrollingTestContainer(ScrollingDirection.Down) { RelativeSizeAxes = Axes.Both };
|
|
|
|
|
|
|
|
protected override void AddHitObject(DrawableHitObject hitObject) => column.Add((DrawableManiaHitObject)hitObject);
|
|
|
|
|
|
|
|
public Column ColumnAt(Vector2 screenSpacePosition) => column;
|
2018-11-15 20:37:22 +08:00
|
|
|
|
|
|
|
public int TotalColumns => 1;
|
2018-11-12 18:41:06 +08:00
|
|
|
}
|
|
|
|
}
|