1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-17 15:52:55 +08:00
osu-lazer/osu.Game.Tests/Visual/Editing/TestSceneHitObjectComposer.cs

57 lines
2.0 KiB
C#
Raw Normal View History

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
2018-04-13 17:19:50 +08:00
using System.Collections.Generic;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Timing;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Types;
2018-04-13 17:19:50 +08:00
using osu.Game.Rulesets.Osu;
using osu.Game.Rulesets.Osu.Edit;
using osu.Game.Rulesets.Osu.Objects;
2020-01-02 00:23:21 +08:00
using osu.Game.Screens.Edit;
2019-03-25 00:02:36 +08:00
using osuTK;
2018-04-13 17:19:50 +08:00
namespace osu.Game.Tests.Visual.Editing
2018-04-13 17:19:50 +08:00
{
[TestFixture]
2019-10-25 18:00:10 +08:00
public class TestSceneHitObjectComposer : EditorClockTestScene
2018-04-13 17:19:50 +08:00
{
[BackgroundDependencyLoader]
private void load()
2018-04-13 17:19:50 +08:00
{
Beatmap.Value = CreateWorkingBeatmap(new Beatmap
2018-04-13 17:19:50 +08:00
{
HitObjects = new List<HitObject>
{
new HitCircle { Position = new Vector2(256, 192), Scale = 0.5f },
new HitCircle { Position = new Vector2(344, 148), Scale = 0.5f },
new Slider
{
Position = new Vector2(128, 256),
Path = new SliderPath(PathType.Linear, new[]
2018-04-13 17:19:50 +08:00
{
Vector2.Zero,
new Vector2(216, 0),
}),
2018-04-13 17:19:50 +08:00
Scale = 0.5f,
}
},
});
2020-01-02 00:23:21 +08:00
var editorBeatmap = new EditorBeatmap(Beatmap.Value.GetPlayableBeatmap(new OsuRuleset().RulesetInfo));
2018-04-13 17:19:50 +08:00
var clock = new DecoupleableInterpolatingFramedClock { IsCoupled = false };
Dependencies.CacheAs<IAdjustableClock>(clock);
Dependencies.CacheAs<IFrameBasedClock>(clock);
2020-01-02 00:23:21 +08:00
Dependencies.CacheAs(editorBeatmap);
Dependencies.CacheAs<IBeatSnapProvider>(editorBeatmap);
2018-04-13 17:19:50 +08:00
2019-08-29 15:06:40 +08:00
Child = new OsuHitObjectComposer(new OsuRuleset());
}
2018-04-13 17:19:50 +08:00
}
}