2021-04-09 08:31:14 +00:00
|
|
|
// 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;
|
2021-08-06 11:06:57 +00:00
|
|
|
using osu.Game.Online.Multiplayer;
|
2021-04-09 08:31:14 +00:00
|
|
|
using osu.Game.Screens.Play.HUD;
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
|
|
|
|
{
|
2021-04-22 14:39:02 +00:00
|
|
|
public partial class MultiSpectatorLeaderboard : MultiplayerGameplayLeaderboard
|
2021-04-09 08:31:14 +00:00
|
|
|
{
|
2022-05-30 10:18:38 +00:00
|
|
|
public MultiSpectatorLeaderboard(MultiplayerRoomUser[] users)
|
|
|
|
: base(users)
|
2021-04-09 08:31:14 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-04-12 13:00:27 +00:00
|
|
|
public void AddClock(int userId, IClock clock)
|
|
|
|
{
|
|
|
|
if (!UserScores.TryGetValue(userId, out var data))
|
2021-07-06 05:56:00 +00:00
|
|
|
throw new ArgumentException(@"Provided user is not tracked by this leaderboard", nameof(userId));
|
2021-04-09 08:31:14 +00:00
|
|
|
|
2022-06-02 06:02:44 +00:00
|
|
|
data.ScoreProcessor.ReferenceClock = clock;
|
2021-04-12 13:00:27 +00:00
|
|
|
}
|
2021-04-09 08:31:14 +00:00
|
|
|
|
|
|
|
protected override void Update()
|
|
|
|
{
|
|
|
|
base.Update();
|
|
|
|
|
2021-04-12 13:00:27 +00:00
|
|
|
foreach (var (_, data) in UserScores)
|
2022-05-30 10:18:38 +00:00
|
|
|
data.ScoreProcessor.UpdateScore();
|
2021-04-09 08:31:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|