2020-12-19 01:30:53 +08: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 JetBrains.Annotations;
|
|
|
|
using osu.Framework.Allocation;
|
2020-12-25 12:38:11 +08:00
|
|
|
using osu.Game.Online.Multiplayer;
|
2020-12-19 01:30:53 +08:00
|
|
|
|
2020-12-25 23:50:00 +08:00
|
|
|
namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
2020-12-19 01:30:53 +08:00
|
|
|
{
|
2020-12-25 12:38:11 +08:00
|
|
|
public abstract class MultiplayerRoomComposite : MultiplayerComposite
|
2020-12-19 01:30:53 +08:00
|
|
|
{
|
|
|
|
[CanBeNull]
|
|
|
|
protected MultiplayerRoom Room => Client.Room;
|
|
|
|
|
|
|
|
[Resolved]
|
|
|
|
protected StatefulMultiplayerClient Client { get; private set; }
|
|
|
|
|
|
|
|
protected override void LoadComplete()
|
|
|
|
{
|
|
|
|
base.LoadComplete();
|
|
|
|
|
|
|
|
Client.RoomChanged += OnRoomChanged;
|
|
|
|
OnRoomChanged();
|
|
|
|
}
|
|
|
|
|
|
|
|
protected virtual void OnRoomChanged()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override void Dispose(bool isDisposing)
|
|
|
|
{
|
|
|
|
if (Client != null)
|
|
|
|
Client.RoomChanged -= OnRoomChanged;
|
|
|
|
|
|
|
|
base.Dispose(isDisposing);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|