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

Fix map would always be converted to itself when actually converting to a different game mode.

This commit is contained in:
smoogipooo 2017-03-12 02:26:10 +09:00
parent f484792546
commit b0ea282a06
7 changed files with 14 additions and 5 deletions

View File

@ -15,6 +15,8 @@ namespace osu.Game.Modes.Catch.UI
{
}
protected override PlayMode PlayMode => PlayMode.Catch;
protected override Playfield<CatchBaseHit> CreatePlayfield() => new CatchPlayfield();
protected override DrawableHitObject<CatchBaseHit> GetVisualRepresentation(CatchBaseHit h) => null;// new DrawableFruit(h);

View File

@ -18,6 +18,8 @@ namespace osu.Game.Modes.Mania.UI
this.columns = columns;
}
protected override PlayMode PlayMode => PlayMode.Mania;
protected override Playfield<ManiaBaseHit> CreatePlayfield() => new ManiaPlayfield(columns);
protected override DrawableHitObject<ManiaBaseHit> GetVisualRepresentation(ManiaBaseHit h)

View File

@ -16,6 +16,8 @@ namespace osu.Game.Modes.Osu.UI
{
}
protected override PlayMode PlayMode => PlayMode.Osu;
protected override Playfield<OsuHitObject> CreatePlayfield() => new OsuPlayfield();
protected override DrawableHitObject<OsuHitObject> GetVisualRepresentation(OsuHitObject h)

View File

@ -15,6 +15,8 @@ namespace osu.Game.Modes.Taiko.UI
{
}
protected override PlayMode PlayMode => PlayMode.Taiko;
protected override Playfield<TaikoBaseHit> CreatePlayfield() => new TaikoPlayfield();
protected override DrawableHitObject<TaikoBaseHit> GetVisualRepresentation(TaikoBaseHit h) => null;// new DrawableTaikoHit(h);

View File

@ -87,9 +87,9 @@ namespace osu.Game.Beatmaps
/// </summary>
/// <typeparam name="T">The type of HitObject the new Beatmap should contain.</typeparam>
/// <returns></returns>
public Beatmap<T> ConvertTo<T>() where T : HitObject
public Beatmap<T> ConvertTo<T>(PlayMode playMode) where T : HitObject
{
return Ruleset.GetRuleset(BeatmapInfo.Mode).CreateBeatmapConverter<T>().Convert(this);
return Ruleset.GetRuleset(playMode).CreateBeatmapConverter<T>().Convert(this);
}
}
}

View File

@ -37,7 +37,7 @@ namespace osu.Game.Beatmaps
protected DifficultyCalculator(Beatmap beatmap)
{
Objects = beatmap.ConvertTo<T>().HitObjects;
Objects = beatmap.ConvertTo<T>(PlayMode).HitObjects;
PreprocessHitObjects();
}

View File

@ -50,15 +50,16 @@ namespace osu.Game.Modes.UI
protected override Container<Drawable> Content => content;
protected override bool AllObjectsJudged => Playfield.HitObjects.Children.All(h => h.Judgement.Result.HasValue);
protected Playfield<TObject> Playfield;
protected abstract PlayMode PlayMode { get; }
protected Playfield<TObject> Playfield;
protected Beatmap<TObject> Beatmap;
private Container content;
protected HitRenderer(Beatmap beatmap)
{
Beatmap = beatmap.ConvertTo<TObject>();
Beatmap = beatmap.ConvertTo<TObject>(PlayMode);
RelativeSizeAxes = Axes.Both;