1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 18:07:24 +08:00
osu-lazer/osu.Game/Screens/Multi/RoomManager.cs
2018-12-12 16:20:11 +09:00

32 lines
864 B
C#

// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Game.Online.API;
using osu.Game.Online.Multiplayer;
namespace osu.Game.Screens.Multi
{
public class RoomManager : Component
{
public IBindableCollection<Room> Rooms => rooms;
private readonly BindableCollection<Room> rooms = new BindableCollection<Room>();
public readonly Bindable<Room> Current = new Bindable<Room>();
[Resolved]
private APIAccess api { get; set; }
public void CreateRoom(Room room)
{
room.Host.Value = api.LocalUser;
// Todo: Perform API request
rooms.Add(room);
}
}
}