mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Merge pull request #13823 from ekrctb/catch-editor-tests
Add some tests for catch editor blueprints
This commit is contained in:
@ -17,11 +17,11 @@ namespace osu.Game.Tests.Visual
|
||||
public abstract class PlacementBlueprintTestScene : OsuManualInputManagerTestScene, IPlacementHandler
|
||||
{
|
||||
protected readonly Container HitObjectContainer;
|
||||
private PlacementBlueprint currentBlueprint;
|
||||
protected PlacementBlueprint CurrentBlueprint { get; private set; }
|
||||
|
||||
protected PlacementBlueprintTestScene()
|
||||
{
|
||||
Add(HitObjectContainer = CreateHitObjectContainer().With(c => c.Clock = new FramedClock(new StopwatchClock())));
|
||||
base.Content.Add(HitObjectContainer = CreateHitObjectContainer().With(c => c.Clock = new FramedClock(new StopwatchClock())));
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
@ -63,9 +63,9 @@ namespace osu.Game.Tests.Visual
|
||||
|
||||
protected void ResetPlacement()
|
||||
{
|
||||
if (currentBlueprint != null)
|
||||
Remove(currentBlueprint);
|
||||
Add(currentBlueprint = CreateBlueprint());
|
||||
if (CurrentBlueprint != null)
|
||||
Remove(CurrentBlueprint);
|
||||
Add(CurrentBlueprint = CreateBlueprint());
|
||||
}
|
||||
|
||||
public void Delete(HitObject hitObject)
|
||||
@ -76,7 +76,7 @@ namespace osu.Game.Tests.Visual
|
||||
{
|
||||
base.Update();
|
||||
|
||||
currentBlueprint.UpdateTimeAndPosition(SnapForBlueprint(currentBlueprint));
|
||||
CurrentBlueprint.UpdateTimeAndPosition(SnapForBlueprint(CurrentBlueprint));
|
||||
}
|
||||
|
||||
protected virtual SnapResult SnapForBlueprint(PlacementBlueprint blueprint) =>
|
||||
|
@ -1,6 +1,7 @@
|
||||
// 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 JetBrains.Annotations;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Timing;
|
||||
@ -23,7 +24,7 @@ namespace osu.Game.Tests.Visual
|
||||
});
|
||||
}
|
||||
|
||||
protected void AddBlueprint(HitObjectSelectionBlueprint blueprint, DrawableHitObject drawableObject)
|
||||
protected void AddBlueprint(HitObjectSelectionBlueprint blueprint, [CanBeNull] DrawableHitObject drawableObject = null)
|
||||
{
|
||||
Add(blueprint.With(d =>
|
||||
{
|
||||
|
Reference in New Issue
Block a user