mirror of
https://github.com/ppy/osu.git
synced 2025-03-19 05:57:19 +08:00
Add comment
This commit is contained in:
parent
4e457871f3
commit
28867fbbb1
@ -1,6 +1,7 @@
|
||||
// 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.
|
||||
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
@ -14,6 +15,9 @@ using osu.Game.Skinning;
|
||||
|
||||
namespace osu.Game.Database
|
||||
{
|
||||
/// <summary>
|
||||
/// A class which centrally manage legacy file exports.
|
||||
/// </summary>
|
||||
[ExcludeFromDynamicCompile]
|
||||
public class LegacyExportManager : Component
|
||||
{
|
||||
@ -26,7 +30,13 @@ namespace osu.Game.Database
|
||||
[Resolved]
|
||||
private INotificationOverlay? notifications { get; set; }
|
||||
|
||||
public async Task ExportAsync(IHasGuidPrimaryKey item)
|
||||
/// <summary>
|
||||
/// Identify the model type and and automatically assigned to the corresponding exporter.
|
||||
/// </summary>
|
||||
/// <param name="item">The model should export.</param>
|
||||
/// <param name="stream">The stream if requires a specific output-stream</param>
|
||||
/// <returns></returns>
|
||||
public async Task ExportAsync(IHasGuidPrimaryKey item, Stream? stream = null)
|
||||
{
|
||||
var notification = new ProgressNotification
|
||||
{
|
||||
@ -39,15 +49,15 @@ namespace osu.Game.Database
|
||||
switch (item)
|
||||
{
|
||||
case SkinInfo:
|
||||
await new LegacySkinExporter(exportStorage, realmAccess, notification).ExportASync(item);
|
||||
await new LegacySkinExporter(exportStorage, realmAccess, notification, stream).ExportASync(item);
|
||||
break;
|
||||
|
||||
case ScoreInfo:
|
||||
await new LegacyScoreExporter(exportStorage, realmAccess, notification).ExportASync(item);
|
||||
await new LegacyScoreExporter(exportStorage, realmAccess, notification, stream).ExportASync(item);
|
||||
break;
|
||||
|
||||
case BeatmapSetInfo:
|
||||
await new LegacyBeatmapExporter(exportStorage, realmAccess, notification).ExportASync(item);
|
||||
await new LegacyBeatmapExporter(exportStorage, realmAccess, notification, stream).ExportASync(item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -48,6 +48,12 @@ namespace osu.Game.Database
|
||||
ShouldDisposeStream = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Export model to <see cref="OutputStream"/>
|
||||
/// if <see cref="OutputStream"/> is null, model will export to default folder.
|
||||
/// </summary>
|
||||
/// <param name="uuid">The model which have Guid.</param>
|
||||
/// <returns></returns>
|
||||
public virtual async Task ExportASync(IHasGuidPrimaryKey uuid)
|
||||
{
|
||||
Guid id = uuid.ID;
|
||||
|
Loading…
x
Reference in New Issue
Block a user