1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 03:27:24 +08:00

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 @@ namespace osu.Game.Database
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 Newtonsoft.Json;
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 @@ namespace osu.Game.Modes.Scoring
[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,