1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 03:22:55 +08:00

Extract interface for solo statistics watcher

This commit is contained in:
Bartłomiej Dach 2022-12-23 23:46:41 +01:00
parent 27afeb9e30
commit 3e782c5f5f
No known key found for this signature in database
2 changed files with 24 additions and 1 deletions

View File

@ -0,0 +1,23 @@
// 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.Framework.Allocation;
using osu.Game.Scoring;
namespace osu.Game.Online.Solo
{
/// <summary>
/// A component that delivers updates to the logged in user's gameplay statistics after completed scores.
/// </summary>
[Cached]
public interface ISoloStatisticsWatcher
{
/// <summary>
/// Registers for a user statistics update after the given <paramref name="score"/> has been processed server-side.
/// </summary>
/// <param name="score">The score to listen for the statistics update for.</param>
/// <param name="onUpdateReady">The callback to be invoked once the statistics update has been prepared.</param>
void RegisterForStatisticsUpdateAfter(ScoreInfo score, Action<SoloStatisticsUpdate> onUpdateReady);
}
}

View File

@ -20,7 +20,7 @@ namespace osu.Game.Online.Solo
/// <summary>
/// A persistent component that binds to the spectator server and API in order to deliver updates about the logged in user's gameplay statistics.
/// </summary>
public partial class SoloStatisticsWatcher : Component
public partial class SoloStatisticsWatcher : Component, ISoloStatisticsWatcher
{
[Resolved]
private SpectatorClient spectatorClient { get; set; } = null!;