2018-01-05 19:21:19 +08:00
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
2017-12-01 23:26:02 +08:00
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using OpenTK;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
using osu.Framework.Timing;
|
2017-12-11 21:20:07 +08:00
|
|
|
using osu.Game.Rulesets.Edit.Layers.Selection;
|
2017-12-01 23:26:02 +08:00
|
|
|
using osu.Game.Rulesets.Osu.Edit;
|
|
|
|
using osu.Game.Rulesets.Osu.Objects;
|
|
|
|
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual
|
|
|
|
{
|
2017-12-08 16:41:10 +08:00
|
|
|
public class TestCaseEditorSelectionLayer : OsuTestCase
|
2017-12-01 23:26:02 +08:00
|
|
|
{
|
2017-12-08 16:41:10 +08:00
|
|
|
public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(SelectionLayer) };
|
2017-12-01 23:26:02 +08:00
|
|
|
|
2017-12-08 16:41:10 +08:00
|
|
|
public TestCaseEditorSelectionLayer()
|
2017-12-01 23:26:02 +08:00
|
|
|
{
|
2017-12-11 21:20:07 +08:00
|
|
|
var playfield = new OsuEditPlayfield
|
2017-12-01 23:26:02 +08:00
|
|
|
{
|
2017-12-11 21:20:07 +08:00
|
|
|
new DrawableHitCircle(new HitCircle { Position = new Vector2(256, 192), Scale = 0.5f }),
|
|
|
|
new DrawableHitCircle(new HitCircle { Position = new Vector2(344, 148), Scale = 0.5f }),
|
|
|
|
new DrawableSlider(new Slider
|
2017-12-01 23:26:02 +08:00
|
|
|
{
|
2017-12-11 21:20:07 +08:00
|
|
|
ControlPoints = new List<Vector2>
|
|
|
|
{
|
|
|
|
new Vector2(128, 256),
|
|
|
|
new Vector2(344, 256),
|
|
|
|
},
|
|
|
|
Distance = 400,
|
|
|
|
Position = new Vector2(128, 256),
|
|
|
|
Velocity = 1,
|
|
|
|
TickDistance = 100,
|
|
|
|
Scale = 0.5f
|
|
|
|
})
|
|
|
|
};
|
2017-12-01 23:26:02 +08:00
|
|
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
{
|
|
|
|
new Container
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Clock = new FramedClock(new StopwatchClock()),
|
|
|
|
Child = playfield
|
|
|
|
},
|
2017-12-08 16:41:10 +08:00
|
|
|
new SelectionLayer(playfield)
|
2017-12-01 23:26:02 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|