Move back to using load(), fix testcase

This commit is contained in:
smoogipoo
2018-01-11 16:51:46 +09:00
parent d998936e9e
commit ab762045d6
3 changed files with 90 additions and 69 deletions

View File

@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using osu.Framework.Allocation;
using OpenTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@ -18,26 +19,10 @@ namespace osu.Game.Tests.Visual
{
public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(SelectionLayer) };
public TestCaseEditorSelectionLayer()
[BackgroundDependencyLoader]
private void load()
{
var playfield = new OsuEditPlayfield
{
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
{
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
})
};
var playfield = new OsuEditPlayfield();
Children = new Drawable[]
{
@ -49,6 +34,22 @@ namespace osu.Game.Tests.Visual
},
new SelectionLayer(playfield)
};
playfield.Add(new DrawableHitCircle(new HitCircle { Position = new Vector2(256, 192), Scale = 0.5f }));
playfield.Add(new DrawableHitCircle(new HitCircle { Position = new Vector2(344, 148), Scale = 0.5f }));
playfield.Add(new DrawableSlider(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
}));
}
}
}