1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-15 05:17:25 +08:00
osu-lazer/osu.Game/Screens/OnlinePlay/Multiplayer/Spectate/MultiSpectatorLeaderboard.cs
Dean Herbert 20da1051d9 Apply NRT to GameplayLeaderboard hierarchy
Just some cleanup work that I wanted to do as part of my last changes.
2022-09-26 16:21:24 +09:00

35 lines
1.0 KiB
C#

// 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.Timing;
using osu.Game.Online.Multiplayer;
using osu.Game.Screens.Play.HUD;
namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
{
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));
data.ScoreProcessor.ReferenceClock = clock;
}
protected override void Update()
{
base.Update();
foreach (var (_, data) in UserScores)
data.ScoreProcessor.UpdateScore();
}
}
}