1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 12:17:26 +08:00

Instantiate HitRenderer with WorkingBeatmap.

This commit is contained in:
smoogipooo 2017-03-12 18:03:13 +09:00
parent b47c9e808e
commit 64aab090d5
12 changed files with 37 additions and 15 deletions

View File

@ -8,6 +8,8 @@ using osu.Framework.MathUtils;
using osu.Framework.Screens.Testing;
using osu.Framework.Timing;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.IO;
using osu.Game.Database;
using osu.Game.Modes.Catch.UI;
using osu.Game.Modes.Mania.UI;
using osu.Game.Modes.Objects;
@ -41,10 +43,19 @@ namespace osu.Desktop.VisualTests.Tests
time += RNG.Next(50, 500);
}
Beatmap beatmap = new Beatmap
WorkingBeatmap beatmap = new TestWorkingBeatmap(new Beatmap
{
HitObjects = objects
};
HitObjects = objects,
BeatmapInfo = new BeatmapInfo
{
Metadata = new BeatmapMetadata
{
Artist = @"Unknown",
Title = @"Sample Beatmap",
Author = @"peppy",
}
}
});
Add(new Drawable[]
{
@ -83,5 +94,16 @@ namespace osu.Desktop.VisualTests.Tests
}
});
}
private class TestWorkingBeatmap : WorkingBeatmap
{
public TestWorkingBeatmap(Beatmap beatmap)
: base(beatmap.BeatmapInfo, beatmap.BeatmapInfo.BeatmapSet)
{
Beatmap = beatmap;
}
protected override ArchiveReader GetReader() => null;
}
}
}

View File

@ -15,7 +15,7 @@ namespace osu.Game.Modes.Catch
{
public class CatchRuleset : Ruleset
{
public override HitRenderer CreateHitRendererWith(Beatmap beatmap) => new CatchHitRenderer(beatmap);
public override HitRenderer CreateHitRendererWith(WorkingBeatmap beatmap) => new CatchHitRenderer(beatmap);
public override IEnumerable<Mod> GetModsFor(ModType type)
{

View File

@ -11,7 +11,7 @@ namespace osu.Game.Modes.Catch.UI
{
public class CatchHitRenderer : HitRenderer<CatchBaseHit>
{
public CatchHitRenderer(Beatmap beatmap)
public CatchHitRenderer(WorkingBeatmap beatmap)
: base(beatmap)
{
}

View File

@ -14,7 +14,7 @@ namespace osu.Game.Modes.Mania
{
public class ManiaRuleset : Ruleset
{
public override HitRenderer CreateHitRendererWith(Beatmap beatmap) => new ManiaHitRenderer(beatmap);
public override HitRenderer CreateHitRendererWith(WorkingBeatmap beatmap) => new ManiaHitRenderer(beatmap);
public override IEnumerable<Mod> GetModsFor(ModType type)
{

View File

@ -13,7 +13,7 @@ namespace osu.Game.Modes.Mania.UI
{
private readonly int columns;
public ManiaHitRenderer(Beatmap beatmap, int columns = 5)
public ManiaHitRenderer(WorkingBeatmap beatmap, int columns = 5)
: base(beatmap)
{
this.columns = columns;

View File

@ -17,7 +17,7 @@ namespace osu.Game.Modes.Osu
{
public class OsuRuleset : Ruleset
{
public override HitRenderer CreateHitRendererWith(Beatmap beatmap) => new OsuHitRenderer(beatmap);
public override HitRenderer CreateHitRendererWith(WorkingBeatmap beatmap) => new OsuHitRenderer(beatmap);
public override IEnumerable<BeatmapStatistic> GetBeatmapStatistics(WorkingBeatmap beatmap) => new[]
{

View File

@ -12,7 +12,7 @@ namespace osu.Game.Modes.Osu.UI
{
public class OsuHitRenderer : HitRenderer<OsuHitObject>
{
public OsuHitRenderer(Beatmap beatmap)
public OsuHitRenderer(WorkingBeatmap beatmap)
: base(beatmap)
{
}

View File

@ -15,7 +15,7 @@ namespace osu.Game.Modes.Taiko
{
public class TaikoRuleset : Ruleset
{
public override HitRenderer CreateHitRendererWith(Beatmap beatmap) => new TaikoHitRenderer(beatmap);
public override HitRenderer CreateHitRendererWith(WorkingBeatmap beatmap) => new TaikoHitRenderer(beatmap);
public override IEnumerable<Mod> GetModsFor(ModType type)
{

View File

@ -11,7 +11,7 @@ namespace osu.Game.Modes.Taiko.UI
{
public class TaikoHitRenderer : HitRenderer<TaikoBaseHit>
{
public TaikoHitRenderer(Beatmap beatmap)
public TaikoHitRenderer(WorkingBeatmap beatmap)
: base(beatmap)
{
}

View File

@ -31,7 +31,7 @@ namespace osu.Game.Modes
public abstract ScoreProcessor CreateScoreProcessor(int hitObjectCount = 0);
public abstract HitRenderer CreateHitRendererWith(Beatmap beatmap);
public abstract HitRenderer CreateHitRendererWith(WorkingBeatmap beatmap);
public abstract HitObjectParser CreateHitObjectParser();

View File

@ -55,9 +55,9 @@ namespace osu.Game.Modes.UI
private Container content;
protected HitRenderer(Beatmap beatmap)
protected HitRenderer(WorkingBeatmap beatmap)
{
Beatmap = CreateBeatmapConverter().Convert(beatmap);
Beatmap = CreateBeatmapConverter().Convert(beatmap.Beatmap);
RelativeSizeAxes = Axes.Both;

View File

@ -128,7 +128,7 @@ namespace osu.Game.Screens.Play
OnQuit = Exit
};
hitRenderer = ruleset.CreateHitRendererWith(beatmap);
hitRenderer = ruleset.CreateHitRendererWith(Beatmap);
if (ReplayInputHandler != null)
{