mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 20:22:55 +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 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,44 +25,31 @@ 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
|
||||||
|
{
|
||||||
|
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,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
new SelectionLayer(playfield)
|
});
|
||||||
};
|
|
||||||
|
|
||||||
var hitCircle1 = new HitCircle { Position = new Vector2(256, 192), Scale = 0.5f };
|
Child = new OsuHitObjectComposer(new OsuRuleset());
|
||||||
var hitCircle2 = new HitCircle { Position = new Vector2(344, 148), Scale = 0.5f };
|
|
||||||
var slider = new Slider
|
|
||||||
{
|
|
||||||
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,
|
|
||||||
};
|
|
||||||
|
|
||||||
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));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user