Use VirtualBeatmapTrack in testcases

This commit is contained in:
smoogipoo
2018-06-28 11:45:48 +09:00
parent 5640385f48
commit c0c94e24b9
3 changed files with 3 additions and 20 deletions

View File

@ -1,12 +1,10 @@
// 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.Linq;
using osu.Framework.Audio.Track;
using osu.Framework.Graphics.Textures;
using osu.Game.Beatmaps;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Objects.Types;
namespace osu.Game.Tests.Beatmaps
{
@ -26,21 +24,6 @@ namespace osu.Game.Tests.Beatmaps
private readonly IBeatmap beatmap;
protected override IBeatmap GetBeatmap() => beatmap;
protected override Texture GetBackground() => null;
protected override Track GetTrack()
{
var lastObject = beatmap.HitObjects.LastOrDefault();
if (lastObject != null)
return new TestTrack(((lastObject as IHasEndTime)?.EndTime ?? lastObject.StartTime) + 1000);
return new TrackVirtual();
}
private class TestTrack : TrackVirtual
{
public TestTrack(double length)
{
Length = length;
}
}
protected override Track GetTrack() => null;
}
}