1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-09 01:37:52 +08:00
osu-lazer/osu.Game/Screens/OnlinePlay/Multiplayer/Spectate/MultiSpectatorLeaderboard.cs

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

37 lines
1.0 KiB
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-06-17 15:37:17 +08:00
#nullable disable
using System;
using osu.Framework.Timing;
using osu.Game.Online.Multiplayer;
using osu.Game.Screens.Play.HUD;
namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
{
2021-04-22 22:39:02 +08:00
public class MultiSpectatorLeaderboard : MultiplayerGameplayLeaderboard
{
public MultiSpectatorLeaderboard(MultiplayerRoomUser[] users)
: base(users)
{
}
public void AddClock(int userId, IClock clock)
{
if (!UserScores.TryGetValue(userId, out var data))
throw new ArgumentException(@"Provided user is not tracked by this leaderboard", nameof(userId));
2022-06-02 14:02:44 +08:00
data.ScoreProcessor.ReferenceClock = clock;
}
protected override void Update()
{
base.Update();
foreach (var (_, data) in UserScores)
data.ScoreProcessor.UpdateScore();
}
}
}