1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 20:07:25 +08:00

Move MockNestedHitObject to own class

This commit is contained in:
Naxess 2021-06-27 15:16:40 +02:00
parent 4cfa0ae5ec
commit c2ceb83bbb
2 changed files with 36 additions and 28 deletions

View File

@ -3,7 +3,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using NUnit.Framework;
using osu.Game.Audio;
using osu.Game.Beatmaps;
@ -11,7 +10,6 @@ using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Edit.Checks;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.Osu.Objects;
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_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]
public void Setup()
{

View 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();
}
}
}