2019-01-24 08:43:03 +00: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 09:19:50 +00: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 06:38:19 +00:00
|
|
|
using osu.Game.Rulesets.Objects.Types;
|
2018-04-13 09:19:50 +00:00
|
|
|
using osu.Game.Rulesets.Osu;
|
|
|
|
using osu.Game.Rulesets.Osu.Edit;
|
|
|
|
using osu.Game.Rulesets.Osu.Objects;
|
2020-01-01 16:23:21 +00:00
|
|
|
using osu.Game.Screens.Edit;
|
2019-03-24 16:02:36 +00:00
|
|
|
using osuTK;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
2020-04-23 08:07:55 +00:00
|
|
|
namespace osu.Game.Tests.Visual.Editing
|
2018-04-13 09:19:50 +00:00
|
|
|
{
|
|
|
|
[TestFixture]
|
2019-10-25 10:00:10 +00:00
|
|
|
public class TestSceneHitObjectComposer : EditorClockTestScene
|
2018-04-13 09:19:50 +00:00
|
|
|
{
|
|
|
|
[BackgroundDependencyLoader]
|
2018-05-23 08:37:39 +00:00
|
|
|
private void load()
|
2018-04-13 09:19:50 +00:00
|
|
|
{
|
2019-05-31 05:40:53 +00:00
|
|
|
Beatmap.Value = CreateWorkingBeatmap(new Beatmap
|
2018-04-13 09:19:50 +00: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 06:38:19 +00:00
|
|
|
Path = new SliderPath(PathType.Linear, new[]
|
2018-04-13 09:19:50 +00:00
|
|
|
{
|
|
|
|
Vector2.Zero,
|
|
|
|
new Vector2(216, 0),
|
2018-11-01 06:38:19 +00:00
|
|
|
}),
|
2018-04-13 09:19:50 +00:00
|
|
|
Scale = 0.5f,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2020-01-01 16:23:21 +00:00
|
|
|
var editorBeatmap = new EditorBeatmap(Beatmap.Value.GetPlayableBeatmap(new OsuRuleset().RulesetInfo));
|
|
|
|
|
2018-04-13 09:19:50 +00:00
|
|
|
var clock = new DecoupleableInterpolatingFramedClock { IsCoupled = false };
|
2018-06-06 11:25:40 +00:00
|
|
|
Dependencies.CacheAs<IAdjustableClock>(clock);
|
|
|
|
Dependencies.CacheAs<IFrameBasedClock>(clock);
|
2020-01-01 16:23:21 +00:00
|
|
|
Dependencies.CacheAs(editorBeatmap);
|
2020-01-23 05:39:56 +00:00
|
|
|
Dependencies.CacheAs<IBeatSnapProvider>(editorBeatmap);
|
2018-04-13 09:19:50 +00:00
|
|
|
|
2019-08-29 07:06:40 +00:00
|
|
|
Child = new OsuHitObjectComposer(new OsuRuleset());
|
2018-10-17 08:41:17 +00:00
|
|
|
}
|
2018-04-13 09:19:50 +00:00
|
|
|
}
|
|
|
|
}
|