1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 15:07:44 +08:00
osu-lazer/osu.Game/Database/LegacyScoreExporter.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
997 B
C#
Raw Normal View History

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
2022-11-19 00:02:35 +08:00
using System.IO;
using System.Linq;
using osu.Framework.Platform;
2022-11-19 00:02:35 +08:00
using osu.Game.Extensions;
using osu.Game.Overlays;
using osu.Game.Scoring;
namespace osu.Game.Database
{
2022-11-17 22:38:24 +08:00
public class LegacyScoreExporter : LegacyModelExporter<ScoreInfo>
{
public LegacyScoreExporter(Storage storage, RealmAccess realm, INotificationOverlay? notifications = null)
: base(storage, realm, notifications)
{
}
protected override string FileExtension => ".osr";
protected override void ExportToStream(ScoreInfo model, Stream stream)
2022-11-19 00:02:35 +08:00
{
var file = model.Files.SingleOrDefault();
if (file == null)
return;
using (var inputStream = UserFileStorage.GetStream(file.File.GetStoragePath()))
inputStream.CopyTo(stream);
2022-11-19 00:02:35 +08:00
}
}
}