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

Split out IPostNotifications into an interface

This commit is contained in:
Dean Herbert 2021-09-30 17:42:12 +09:00
parent fd13142a15
commit 0a00bc7795
4 changed files with 19 additions and 8 deletions

View File

@ -14,6 +14,7 @@ using osu.Framework.Graphics;
using osu.Framework.Logging; using osu.Framework.Logging;
using osu.Framework.Platform; using osu.Framework.Platform;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Database;
using osu.Game.IO; using osu.Game.IO;
using osu.Game.IO.Legacy; using osu.Game.IO.Legacy;
using osu.Game.Overlays.Notifications; using osu.Game.Overlays.Notifications;
@ -27,7 +28,7 @@ namespace osu.Game.Collections
/// This is currently reading and writing from the osu-stable file format. This is a temporary arrangement until we refactor the /// This is currently reading and writing from the osu-stable file format. This is a temporary arrangement until we refactor the
/// database backing the game. Going forward writing should be done in a similar way to other model stores. /// database backing the game. Going forward writing should be done in a similar way to other model stores.
/// </remarks> /// </remarks>
public class CollectionManager : Component public class CollectionManager : Component, IPostNotifications
{ {
/// <summary> /// <summary>
/// Database version in stable-compatible YYYYMMDD format. /// Database version in stable-compatible YYYYMMDD format.
@ -106,9 +107,6 @@ namespace osu.Game.Collections
backgroundSave(); backgroundSave();
}); });
/// <summary>
/// Set an endpoint for notifications to be posted to.
/// </summary>
public Action<Notification> PostNotification { protected get; set; } public Action<Notification> PostNotification { protected get; set; }
/// <summary> /// <summary>

View File

@ -57,9 +57,6 @@ namespace osu.Game.Database
/// </summary> /// </summary>
private static readonly ThreadedTaskScheduler import_scheduler_low_priority = new ThreadedTaskScheduler(import_queue_request_concurrency, nameof(ArchiveModelManager<TModel, TFileModel>)); private static readonly ThreadedTaskScheduler import_scheduler_low_priority = new ThreadedTaskScheduler(import_queue_request_concurrency, nameof(ArchiveModelManager<TModel, TFileModel>));
/// <summary>
/// Set an endpoint for notifications to be posted to.
/// </summary>
public Action<Notification> PostNotification { protected get; set; } public Action<Notification> PostNotification { protected get; set; }
/// <summary> /// <summary>

View File

@ -17,7 +17,7 @@ namespace osu.Game.Database
/// Represents a model manager that publishes events when <typeparamref name="TModel"/>s are added or removed. /// Represents a model manager that publishes events when <typeparamref name="TModel"/>s are added or removed.
/// </summary> /// </summary>
/// <typeparam name="TModel">The model type.</typeparam> /// <typeparam name="TModel">The model type.</typeparam>
public interface IModelManager<TModel> public interface IModelManager<TModel> : IPostNotifications
where TModel : class where TModel : class
{ {
/// <summary> /// <summary>

View File

@ -0,0 +1,16 @@
// 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;
using osu.Game.Overlays.Notifications;
namespace osu.Game.Database
{
public interface IPostNotifications
{
/// <summary>
/// And action which will be fired when a notification should be presented to the user.
/// </summary>
public Action<Notification> PostNotification { set; }
}
}