1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-14 19:47:24 +08:00
osu-lazer/osu.Game.Tests/Visual/TestCaseHitObjectComposer.cs

73 lines
2.5 KiB
C#
Raw Normal View History

2018-01-05 19:21:19 +08:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Collections.Generic;
2018-03-29 16:19:14 +08:00
using JetBrains.Annotations;
2018-03-02 14:34:31 +08:00
using NUnit.Framework;
using osu.Framework.Allocation;
2018-03-15 17:24:57 +08:00
using osu.Framework.Timing;
using OpenTK;
2018-01-30 17:22:40 +08:00
using osu.Game.Beatmaps;
2018-02-22 13:22:04 +08:00
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Osu;
using osu.Game.Rulesets.Osu.Edit;
using osu.Game.Rulesets.Osu.Objects;
2018-03-14 14:18:21 +08:00
using osu.Game.Screens.Edit.Screens.Compose.Layers;
using osu.Game.Tests.Beatmaps;
namespace osu.Game.Tests.Visual
{
2018-03-02 14:34:31 +08:00
[TestFixture]
2018-04-06 14:18:01 +08:00
public class TestCaseHitObjectComposer : OsuTestCase
{
public override IReadOnlyList<Type> RequiredTypes => new[]
{
typeof(MaskSelection),
typeof(DragLayer),
typeof(HitObjectComposer),
typeof(OsuHitObjectComposer),
2018-03-14 14:18:21 +08:00
typeof(HitObjectMaskLayer),
2018-03-29 16:19:14 +08:00
typeof(NotNullAttribute)
};
2018-03-19 15:27:52 +08:00
private DependencyContainer dependencies;
protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent)
=> dependencies = new DependencyContainer(parent);
[BackgroundDependencyLoader]
private void load(OsuGameBase osuGame)
{
osuGame.Beatmap.Value = new TestWorkingBeatmap(new Beatmap
{
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
{
2018-02-23 20:03:45 +08:00
Position = new Vector2(128, 256),
ControlPoints = new List<Vector2>
{
2018-02-23 20:03:45 +08:00
Vector2.Zero,
new Vector2(216, 0),
},
Distance = 400,
Velocity = 1,
TickDistance = 100,
Scale = 0.5f,
}
},
});
2018-01-30 17:22:40 +08:00
2018-03-15 17:24:57 +08:00
var clock = new DecoupleableInterpolatingFramedClock { IsCoupled = false };
2018-03-19 15:27:52 +08:00
dependencies.CacheAs<IAdjustableClock>(clock);
dependencies.CacheAs<IFrameBasedClock>(clock);
2018-03-15 17:24:57 +08:00
2018-03-19 15:27:52 +08:00
Child = new OsuHitObjectComposer(new OsuRuleset());
}
}
}