1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-18 14:12:54 +08:00
osu-lazer/osu.Game.Rulesets.Osu.Tests/TestCaseSliderSelectionBlueprint.cs

56 lines
1.8 KiB
C#
Raw Normal View History

2018-10-25 17:48:11 +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 System;
using System.Collections.Generic;
2018-10-25 17:48:11 +08:00
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Objects.Types;
2018-11-07 15:08:56 +08:00
using osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders;
using osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components;
2018-10-25 17:48:11 +08:00
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables;
using osu.Game.Tests.Visual;
using OpenTK;
namespace osu.Game.Rulesets.Osu.Tests
{
2018-11-06 17:06:13 +08:00
public class TestCaseSliderSelectionBlueprint : SelectionBlueprintTestCase
2018-10-25 17:48:11 +08:00
{
public override IReadOnlyList<Type> RequiredTypes => new[]
{
2018-11-06 16:56:04 +08:00
typeof(SliderSelectionBlueprint),
typeof(SliderCircleSelectionBlueprint),
typeof(SliderBodyPiece),
typeof(SliderCircle),
typeof(PathControlPointVisualiser),
typeof(PathControlPointPiece)
};
2018-10-25 17:48:11 +08:00
private readonly DrawableSlider drawableObject;
2018-11-06 17:06:13 +08:00
public TestCaseSliderSelectionBlueprint()
2018-10-25 17:48:11 +08:00
{
var slider = new Slider
{
Position = new Vector2(256, 192),
ControlPoints = new[]
2018-10-25 17:48:11 +08:00
{
Vector2.Zero,
new Vector2(150, 150),
new Vector2(300, 0)
},
PathType = PathType.Bezier,
2018-10-25 17:48:11 +08:00
Distance = 350
};
slider.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { CircleSize = 2 });
Add(drawableObject = new DrawableSlider(slider));
}
2018-11-07 14:04:48 +08:00
protected override SelectionBlueprint CreateBlueprint() => new SliderSelectionBlueprint(drawableObject);
2018-10-25 17:48:11 +08:00
}
}