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

Add legacy beatmap flag.

This commit is contained in:
smoogipooo 2017-03-17 14:24:46 +09:00
parent 163a21a7bf
commit 862c4c408f
5 changed files with 48 additions and 0 deletions

View File

@ -70,5 +70,14 @@ namespace osu.Game.Beatmaps
/// </summary>
/// <returns>The star difficulty.</returns>
public double CalculateStarDifficulty() => Ruleset.GetRuleset(BeatmapInfo.Mode).CreateDifficultyCalculator(this).Calculate();
/// <summary>
/// Constructs a new beatmap.
/// </summary>
/// <param name="original">The original beatmap to use the parameters of.</param>
public Beatmap(Beatmap original = null)
: base(original)
{
}
}
}

View File

@ -10,6 +10,7 @@ using osu.Game.Beatmaps.Samples;
using osu.Game.Beatmaps.Timing;
using osu.Game.Modes;
using osu.Game.Modes.Objects;
using osu.Game.Beatmaps.Legacy;
namespace osu.Game.Beatmaps.Formats
{
@ -242,6 +243,16 @@ namespace osu.Game.Beatmaps.Formats
}
}
protected override Beatmap ParseFile(TextReader stream)
{
return new LegacyBeatmap(base.ParseFile(stream));
}
public override Beatmap Decode(TextReader stream)
{
return new LegacyBeatmap(base.Decode(stream));
}
protected override void ParseFile(TextReader stream, Beatmap beatmap)
{
HitObjectParser parser = null;

View File

@ -0,0 +1,9 @@
namespace osu.Game.Beatmaps.Legacy
{
/// <summary>
/// A Beatmap that was loaded from a legacy .osu beatmap file (version &lt;=15).
/// </summary>
public interface IIsLegacy
{
}
}

View File

@ -0,0 +1,17 @@
namespace osu.Game.Beatmaps.Legacy
{
/// <summary>
/// A type of Beatmap loaded from a legacy .osu beatmap file (version &lt;=15).
/// </summary>
internal class LegacyBeatmap : Beatmap, IIsLegacy
{
/// <summary>
/// Constructs a new beatmap.
/// </summary>
/// <param name="original">The original beatmap to use the parameters of.</param>
public LegacyBeatmap(Beatmap original = null)
: base(original)
{
}
}
}

View File

@ -75,7 +75,9 @@
<Compile Include="Beatmaps\DifficultyCalculator.cs" />
<Compile Include="Beatmaps\IBeatmapCoverter.cs" />
<Compile Include="Beatmaps\IBeatmapProcessor.cs" />
<Compile Include="Beatmaps\Legacy\LegacyBeatmap.cs" />
<Compile Include="Beatmaps\Timing\TimingInfo.cs" />
<Compile Include="Beatmaps\Legacy\IIsLegacy.cs" />
<Compile Include="Database\ScoreDatabase.cs" />
<Compile Include="Graphics\Backgrounds\Triangles.cs" />
<Compile Include="Graphics\Cursor\CursorTrail.cs" />