2019-01-24 16:43:03 +08:00
|
|
|
// 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;
|
2018-11-01 14:38:19 +08:00
|
|
|
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
|
|
|
|
2020-04-23 16:07:55 +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]
|
2018-05-23 16:37:39 +08:00
|
|
|
private void load()
|
2018-04-13 17:19:50 +08:00
|
|
|
{
|
2019-05-31 13:40:53 +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),
|
2018-11-01 14:38:19 +08:00
|
|
|
Path = new SliderPath(PathType.Linear, new[]
|
2018-04-13 17:19:50 +08:00
|
|
|
{
|
|
|
|
Vector2.Zero,
|
|
|
|
new Vector2(216, 0),
|
2018-11-01 14:38:19 +08:00
|
|
|
}),
|
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 };
|
2018-06-06 19:25:40 +08:00
|
|
|
Dependencies.CacheAs<IAdjustableClock>(clock);
|
|
|
|
Dependencies.CacheAs<IFrameBasedClock>(clock);
|
2020-01-02 00:23:21 +08:00
|
|
|
Dependencies.CacheAs(editorBeatmap);
|
2020-01-23 13:39:56 +08:00
|
|
|
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-10-17 16:41:17 +08:00
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
}
|
|
|
|
}
|