mirror of
https://github.com/osukey/osukey.git
synced 2025-06-10 05:48:05 +09:00
Move MockNestedHitObject
to own class
This commit is contained in:
parent
4cfa0ae5ec
commit
c2ceb83bbb
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Game.Audio;
|
using osu.Game.Audio;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
@ -11,7 +10,6 @@ using osu.Game.Beatmaps.ControlPoints;
|
|||||||
using osu.Game.Rulesets.Edit;
|
using osu.Game.Rulesets.Edit;
|
||||||
using osu.Game.Rulesets.Edit.Checks;
|
using osu.Game.Rulesets.Edit.Checks;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
|
||||||
using osu.Game.Rulesets.Osu.Objects;
|
using osu.Game.Rulesets.Osu.Objects;
|
||||||
using osu.Game.Tests.Beatmaps;
|
using osu.Game.Tests.Beatmaps;
|
||||||
|
|
||||||
@ -27,32 +25,6 @@ namespace osu.Game.Tests.Editing.Checks
|
|||||||
private const int volume_low = 15;
|
private const int volume_low = 15;
|
||||||
private const int volume_muted = 5;
|
private const int volume_muted = 5;
|
||||||
|
|
||||||
private sealed class MockNestableHitObject : HitObject, IHasDuration
|
|
||||||
{
|
|
||||||
private readonly IEnumerable<HitObject> toBeNested;
|
|
||||||
|
|
||||||
public MockNestableHitObject(IEnumerable<HitObject> toBeNested, double startTime, double endTime)
|
|
||||||
{
|
|
||||||
this.toBeNested = toBeNested;
|
|
||||||
StartTime = startTime;
|
|
||||||
EndTime = endTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void CreateNestedHitObjects(CancellationToken cancellationToken)
|
|
||||||
{
|
|
||||||
foreach (var hitObject in toBeNested)
|
|
||||||
AddNested(hitObject);
|
|
||||||
}
|
|
||||||
|
|
||||||
public double EndTime { get; }
|
|
||||||
|
|
||||||
public double Duration
|
|
||||||
{
|
|
||||||
get => EndTime - StartTime;
|
|
||||||
set => throw new System.NotImplementedException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void Setup()
|
public void Setup()
|
||||||
{
|
{
|
||||||
|
36
osu.Game.Tests/Editing/Checks/MockNestableHitObject.cs
Normal file
36
osu.Game.Tests/Editing/Checks/MockNestableHitObject.cs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
// 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 System.Collections.Generic;
|
||||||
|
using System.Threading;
|
||||||
|
using osu.Game.Rulesets.Objects;
|
||||||
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
|
|
||||||
|
namespace osu.Game.Tests.Editing.Checks
|
||||||
|
{
|
||||||
|
public sealed class MockNestableHitObject : HitObject, IHasDuration
|
||||||
|
{
|
||||||
|
private readonly IEnumerable<HitObject> toBeNested;
|
||||||
|
|
||||||
|
public MockNestableHitObject(IEnumerable<HitObject> toBeNested, double startTime, double endTime)
|
||||||
|
{
|
||||||
|
this.toBeNested = toBeNested;
|
||||||
|
StartTime = startTime;
|
||||||
|
EndTime = endTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void CreateNestedHitObjects(CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
foreach (var hitObject in toBeNested)
|
||||||
|
AddNested(hitObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
public double EndTime { get; }
|
||||||
|
|
||||||
|
public double Duration
|
||||||
|
{
|
||||||
|
get => EndTime - StartTime;
|
||||||
|
set => throw new System.NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user