1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-12 04:49:40 +08:00
osu-lazer/osu.Game/Tests/Beatmaps/TestWorkingBeatmap.cs

65 lines
2.2 KiB
C#
Raw Normal View History

// 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.
2018-04-13 17:19:50 +08:00
using System.IO;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
2018-04-13 17:19:50 +08:00
using osu.Framework.Audio.Track;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.OpenGL.Textures;
2018-04-13 17:19:50 +08:00
using osu.Framework.Graphics.Textures;
using osu.Game.Audio;
2018-04-13 17:19:50 +08:00
using osu.Game.Beatmaps;
using osu.Game.Skinning;
2019-11-21 17:50:54 +08:00
using osu.Game.Storyboards;
2018-04-13 17:19:50 +08:00
namespace osu.Game.Tests.Beatmaps
{
public class TestWorkingBeatmap : WorkingBeatmap
{
private readonly IBeatmap beatmap;
2019-11-21 17:50:54 +08:00
private readonly Storyboard storyboard;
/// <summary>
/// Create an instance which provides the <see cref="IBeatmap"/> when requested.
/// </summary>
2019-11-21 17:50:54 +08:00
/// <param name="beatmap">The beatmap.</param>
/// <param name="storyboard">An optional storyboard.</param>
/// <param name="audioManager">The <see cref="AudioManager"/>.</param>
public TestWorkingBeatmap(IBeatmap beatmap, Storyboard storyboard = null, AudioManager audioManager = null)
: base(beatmap.BeatmapInfo, audioManager)
2018-04-13 17:19:50 +08:00
{
this.beatmap = beatmap;
2019-11-21 17:50:54 +08:00
this.storyboard = storyboard;
2018-04-13 17:19:50 +08:00
}
public override bool TrackLoaded => true;
public override bool BeatmapLoaded => true;
2018-04-19 19:44:38 +08:00
protected override IBeatmap GetBeatmap() => beatmap;
2019-11-21 17:50:54 +08:00
protected override Storyboard GetStoryboard() => storyboard ?? base.GetStoryboard();
protected override ISkin GetSkin() => new EmptySkin();
public override Stream GetStream(string storagePath) => null;
protected override Texture GetBackground() => null;
2019-02-19 11:35:52 +08:00
2020-08-07 21:31:41 +08:00
protected override Track GetBeatmapTrack() => null;
private class EmptySkin : ISkin
{
public Drawable GetDrawableComponent(ISkinComponent component) => null;
public Texture GetTexture(string componentName, WrapMode wrapModeS, WrapMode wrapModeT) => null;
public ISample GetSample(ISampleInfo sampleInfo) => null;
public IBindable<TValue> GetConfig<TLookup, TValue>(TLookup lookup) => null;
}
2018-04-13 17:19:50 +08:00
}
}