Properly bind WaitingOnFrames

This commit is contained in:
smoogipoo 2021-04-15 19:37:45 +09:00
parent 33cc5c5cb3
commit b391a8f94e

View File

@ -1,6 +1,7 @@
// 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 osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Timing;
using osu.Game.Beatmaps;
@ -12,14 +13,20 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
{
public class MultiplayerSpectatorPlayer : SpectatorPlayer
{
private readonly SpectatorCatchUpSlaveClock gameplayClock;
private readonly ISpectatorSlaveClock gameplayClock;
public MultiplayerSpectatorPlayer(Score score, SpectatorCatchUpSlaveClock gameplayClock)
public MultiplayerSpectatorPlayer(Score score, ISpectatorSlaveClock gameplayClock)
: base(score)
{
this.gameplayClock = gameplayClock;
}
[BackgroundDependencyLoader]
private void load()
{
gameplayClock.WaitingOnFrames.BindTo(DrawableRuleset.FrameStableClock.WaitingOnFrames);
}
protected override GameplayClockContainer CreateGameplayClockContainer(WorkingBeatmap beatmap, double gameplayStart)
=> new SubGameplayClockContainer(gameplayClock);
}