mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 17:32:54 +08:00
Rewrite SelectionLayer testcase to construct an entire HitObjectComposer
This commit is contained in:
parent
4a5cd6520c
commit
2c37a7e19f
@ -5,15 +5,13 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Allocation;
|
||||
using OpenTK;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.ControlPoints;
|
||||
using osu.Game.Rulesets.Edit.Layers.Selection;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
using osu.Game.Rulesets.Osu.Edit;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
||||
using osu.Game.Tests.Beatmaps;
|
||||
|
||||
namespace osu.Game.Tests.Visual
|
||||
{
|
||||
@ -27,24 +25,15 @@ namespace osu.Game.Tests.Visual
|
||||
};
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
private void load(OsuGameBase osuGame)
|
||||
{
|
||||
var playfield = new OsuEditPlayfield();
|
||||
|
||||
Children = new Drawable[]
|
||||
osuGame.Beatmap.Value = new TestWorkingBeatmap(new Beatmap
|
||||
{
|
||||
new Container
|
||||
HitObjects = new List<HitObject>
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Clock = new FramedClock(new StopwatchClock()),
|
||||
Child = playfield
|
||||
},
|
||||
new SelectionLayer(playfield)
|
||||
};
|
||||
|
||||
var hitCircle1 = new HitCircle { Position = new Vector2(256, 192), Scale = 0.5f };
|
||||
var hitCircle2 = new HitCircle { Position = new Vector2(344, 148), Scale = 0.5f };
|
||||
var slider = new Slider
|
||||
new HitCircle { Position = new Vector2(256, 192), Scale = 0.5f },
|
||||
new HitCircle { Position = new Vector2(344, 148), Scale = 0.5f },
|
||||
new Slider
|
||||
{
|
||||
ControlPoints = new List<Vector2>
|
||||
{
|
||||
@ -56,15 +45,11 @@ namespace osu.Game.Tests.Visual
|
||||
Velocity = 1,
|
||||
TickDistance = 100,
|
||||
Scale = 0.5f,
|
||||
};
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
hitCircle1.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
|
||||
hitCircle2.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
|
||||
slider.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
|
||||
|
||||
playfield.Add(new DrawableHitCircle(hitCircle1));
|
||||
playfield.Add(new DrawableHitCircle(hitCircle2));
|
||||
playfield.Add(new DrawableSlider(slider));
|
||||
Child = new OsuHitObjectComposer(new OsuRuleset());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user