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