2020-12-18 23:15:41 +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 System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Bindables;
|
|
|
|
using osu.Game.Online;
|
|
|
|
using osu.Game.Online.API;
|
|
|
|
using osu.Game.Online.Multiplayer;
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Multi.Components
|
|
|
|
{
|
|
|
|
public abstract class RoomPollingComponent : PollingComponent
|
|
|
|
{
|
|
|
|
public Action<List<Room>> RoomsReceived;
|
|
|
|
|
2020-12-20 16:46:45 +08:00
|
|
|
public readonly Bindable<bool> InitialRoomsReceived = new Bindable<bool>();
|
2020-12-18 23:15:41 +08:00
|
|
|
|
|
|
|
[Resolved]
|
|
|
|
protected IAPIProvider API { get; private set; }
|
|
|
|
|
|
|
|
protected void NotifyRoomsReceived(List<Room> rooms)
|
|
|
|
{
|
2020-12-20 16:46:45 +08:00
|
|
|
InitialRoomsReceived.Value = true;
|
2020-12-18 23:15:41 +08:00
|
|
|
RoomsReceived?.Invoke(rooms);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|