mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Rename test cases to test scenes inline with the framework change
This commit is contained in:
65
osu.Game/Tests/Visual/PlacementBlueprintTestScene.cs
Normal file
65
osu.Game/Tests/Visual/PlacementBlueprintTestScene.cs
Normal file
@ -0,0 +1,65 @@
|
||||
// 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.
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Game.Rulesets.Edit;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Screens.Edit.Compose;
|
||||
|
||||
namespace osu.Game.Tests.Visual
|
||||
{
|
||||
[Cached(Type = typeof(IPlacementHandler))]
|
||||
public abstract class PlacementBlueprintTestScene : OsuTestScene, IPlacementHandler
|
||||
{
|
||||
protected readonly Container HitObjectContainer;
|
||||
private PlacementBlueprint currentBlueprint;
|
||||
|
||||
protected PlacementBlueprintTestScene()
|
||||
{
|
||||
Beatmap.Value.BeatmapInfo.BaseDifficulty.CircleSize = 2;
|
||||
|
||||
Add(HitObjectContainer = CreateHitObjectContainer());
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
Add(currentBlueprint = CreateBlueprint());
|
||||
}
|
||||
|
||||
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
|
||||
{
|
||||
var dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
|
||||
dependencies.CacheAs<IAdjustableClock>(new StopwatchClock());
|
||||
|
||||
return dependencies;
|
||||
}
|
||||
|
||||
public void BeginPlacement(HitObject hitObject)
|
||||
{
|
||||
}
|
||||
|
||||
public void EndPlacement(HitObject hitObject)
|
||||
{
|
||||
AddHitObject(CreateHitObject(hitObject));
|
||||
|
||||
Remove(currentBlueprint);
|
||||
Add(currentBlueprint = CreateBlueprint());
|
||||
}
|
||||
|
||||
public void Delete(HitObject hitObject)
|
||||
{
|
||||
}
|
||||
|
||||
protected virtual Container CreateHitObjectContainer() => new Container { RelativeSizeAxes = Axes.Both };
|
||||
|
||||
protected virtual void AddHitObject(DrawableHitObject hitObject) => HitObjectContainer.Add(hitObject);
|
||||
|
||||
protected abstract DrawableHitObject CreateHitObject(HitObject hitObject);
|
||||
protected abstract PlacementBlueprint CreateBlueprint();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user