1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-07 11:07:32 +08:00
osu-lazer/osu.Game/Screens/OnlinePlay/Multiplayer/Spectate/MultiplayerSpectatorPlayer.cs

43 lines
1.4 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.
2021-04-15 18:37:45 +08:00
using osu.Framework.Allocation;
using osu.Framework.Timing;
using osu.Game.Beatmaps;
using osu.Game.Scoring;
using osu.Game.Screens.OnlinePlay.Multiplayer.Spectate.Sync;
using osu.Game.Screens.Play;
namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
{
public class MultiplayerSpectatorPlayer : SpectatorPlayer
{
private readonly ISlaveClock gameplayClock;
public MultiplayerSpectatorPlayer(Score score, ISlaveClock gameplayClock)
: base(score)
{
this.gameplayClock = gameplayClock;
}
2021-04-15 18:37:45 +08:00
[BackgroundDependencyLoader]
private void load()
{
gameplayClock.WaitingOnFrames.BindTo(DrawableRuleset.FrameStableClock.WaitingOnFrames);
}
protected override GameplayClockContainer CreateGameplayClockContainer(WorkingBeatmap beatmap, double gameplayStart)
=> new SubGameplayClockContainer(gameplayClock);
}
public class SubGameplayClockContainer : GameplayClockContainer
{
public SubGameplayClockContainer(IClock sourceClock)
: base(sourceClock)
{
}
protected override GameplayClock CreateGameplayClock(IFrameBasedClock source) => new GameplayClock(source);
}
}