Centralise access to WorkingBeatmaps.

They can now only be instantiated from BeatmapDatabase and are abstract (to avoid misuse).
This commit is contained in:
Dean Herbert
2017-02-24 13:43:21 +09:00
parent 355bbb6324
commit 3a89348413
6 changed files with 44 additions and 35 deletions

View File

@ -8,6 +8,7 @@ using osu.Game.Beatmaps;
using osu.Game.Beatmaps.Formats;
using OpenTK;
using osu.Framework.Graphics.Sprites;
using osu.Game.Beatmaps.IO;
using osu.Game.Database;
using osu.Game.Modes;
using osu.Game.Modes.Objects;
@ -72,7 +73,7 @@ namespace osu.Desktop.VisualTests.Tests
decoder.Process(b);
beatmap = new WorkingBeatmap(b);
beatmap = new TestWorkingBeatmap(b);
}
Add(new Box
@ -90,5 +91,16 @@ namespace osu.Desktop.VisualTests.Tests
Beatmap = beatmap
});
}
class TestWorkingBeatmap : WorkingBeatmap
{
public TestWorkingBeatmap(Beatmap beatmap)
: base(beatmap.BeatmapInfo, beatmap.BeatmapInfo.BeatmapSet)
{
Beatmap = beatmap;
}
protected override ArchiveReader GetReader() => null;
}
}
}