Add virtual method to instantiate legacy replays.

This commit is contained in:
smoogipooo 2017-03-24 14:03:46 +09:00
parent b225ae82be
commit 136665e52e
2 changed files with 9 additions and 1 deletions

View File

@ -101,7 +101,7 @@ public Score ReadReplayFile(string replayFilename)
using (var lzma = new LzmaStream(properties, replayInStream, compressedSize, outSize))
using (var reader = new StreamReader(lzma))
score.Replay = new LegacyReplay(reader);
score.Replay = score.CreateLegacyReplayFrom(reader);
}
}

View File

@ -6,6 +6,7 @@
using osu.Game.Database;
using osu.Game.Modes.Mods;
using osu.Game.Users;
using System.IO;
namespace osu.Game.Modes.Scoring
{
@ -43,6 +44,13 @@ public class Score
[JsonProperty(@"date")]
public DateTime Date;
/// <summary>
/// Creates a legacy replay which is read from a stream.
/// </summary>
/// <param name="reader">The stream reader.</param>
/// <returns>The replay.</returns>
public virtual Replay CreateLegacyReplayFrom(StreamReader reader) => new LegacyReplay(reader);
// [JsonProperty(@"count50")] 0,
//[JsonProperty(@"count100")] 0,
//[JsonProperty(@"count300")] 100,