1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-21 12:12:56 +08:00

Rewrite SelectionLayer testcase to construct an entire HitObjectComposer

This commit is contained in:
smoogipoo 2018-02-20 13:50:55 +09:00 committed by Dean Herbert
parent 7fd7dc1538
commit 6b8b39abc5

View File

@ -5,15 +5,13 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using OpenTK; using OpenTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Timing;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Rulesets.Edit.Layers.Selection; 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.Edit;
using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables; using osu.Game.Tests.Beatmaps;
namespace osu.Game.Tests.Visual namespace osu.Game.Tests.Visual
{ {
@ -27,24 +25,15 @@ namespace osu.Game.Tests.Visual
}; };
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load(OsuGameBase osuGame)
{ {
var playfield = new OsuEditPlayfield(); osuGame.Beatmap.Value = new TestWorkingBeatmap(new Beatmap
Children = new Drawable[]
{ {
new Container HitObjects = new List<HitObject>
{ {
RelativeSizeAxes = Axes.Both, new HitCircle { Position = new Vector2(256, 192), Scale = 0.5f },
Clock = new FramedClock(new StopwatchClock()), new HitCircle { Position = new Vector2(344, 148), Scale = 0.5f },
Child = playfield new Slider
},
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
{ {
ControlPoints = new List<Vector2> ControlPoints = new List<Vector2>
{ {
@ -56,15 +45,11 @@ namespace osu.Game.Tests.Visual
Velocity = 1, Velocity = 1,
TickDistance = 100, TickDistance = 100,
Scale = 0.5f, Scale = 0.5f,
}; }
},
});
hitCircle1.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); Child = new OsuHitObjectComposer(new OsuRuleset());
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));
} }
} }
} }