1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 03:02:53 +08:00
osu-lazer/osu.Game.Rulesets.Mania.Tests/Editor/ManiaPlacementBlueprintTestScene.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

65 lines
2.2 KiB
C#
Raw Normal View History

// 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.
2018-11-12 18:41:06 +08:00
2022-06-17 15:37:17 +08:00
#nullable disable
2019-04-10 16:54:57 +08:00
using System;
using System.Collections.Generic;
2018-11-12 18:41:06 +08:00
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Timing;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Mania.Beatmaps;
2018-11-12 18:41:06 +08:00
using osu.Game.Rulesets.Mania.Objects.Drawables;
using osu.Game.Rulesets.Mania.UI;
2019-04-10 16:54:57 +08:00
using osu.Game.Rulesets.Mods;
2018-11-12 18:41:06 +08:00
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.Graphics;
2018-11-12 18:41:06 +08:00
namespace osu.Game.Rulesets.Mania.Tests.Editor
2018-11-12 18:41:06 +08:00
{
public abstract partial class ManiaPlacementBlueprintTestScene : PlacementBlueprintTestScene
2018-11-12 18:41:06 +08:00
{
private readonly Column column;
2019-04-10 16:54:57 +08:00
[Cached(typeof(IReadOnlyList<Mod>))]
private IReadOnlyList<Mod> mods { get; set; } = Array.Empty<Mod>();
[Cached(typeof(IScrollingInfo))]
private IScrollingInfo scrollingInfo;
[Cached]
private readonly StageDefinition stage = new StageDefinition(5);
protected ManiaPlacementBlueprintTestScene()
2018-11-12 18:41:06 +08:00
{
scrollingInfo = ((ScrollingTestContainer)HitObjectContainer).ScrollingInfo;
Add(column = new Column(0, false)
2018-11-12 18:41:06 +08:00
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
2022-10-05 19:02:02 +08:00
AccentColour = { Value = Color4.OrangeRed },
2018-11-12 18:41:06 +08:00
Clock = new FramedClock(new StopwatchClock()), // No scroll
});
}
protected override SnapResult SnapForBlueprint(PlacementBlueprint blueprint)
{
double time = column.TimeAtScreenSpacePosition(InputManager.CurrentState.Mouse.Position);
var pos = column.ScreenSpacePositionAtTime(time);
2020-05-25 18:21:53 +08:00
return new SnapResult(pos, time, column);
}
2018-11-12 18:41:06 +08:00
protected override Container CreateHitObjectContainer() => new ScrollingTestContainer(ScrollingDirection.Down) { RelativeSizeAxes = Axes.Both };
protected override void AddHitObject(DrawableHitObject hitObject) => column.Add((DrawableManiaHitObject)hitObject);
2020-05-22 10:35:26 +08:00
public ManiaPlayfield Playfield => null;
2018-11-12 18:41:06 +08:00
}
}