2020-12-04 14:34:31 +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;
|
2020-12-07 17:50:02 +08:00
|
|
|
using System.Collections.Generic;
|
2020-12-04 14:34:31 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Online.RealtimeMultiplayer
|
|
|
|
{
|
|
|
|
[Serializable]
|
|
|
|
public class MultiplayerRoom
|
|
|
|
{
|
|
|
|
public long RoomID { get; set; }
|
|
|
|
|
|
|
|
public MultiplayerRoomState State { get; set; }
|
2020-12-07 17:50:02 +08:00
|
|
|
|
|
|
|
public IReadOnlyList<MultiplayerRoomUser> Users => users;
|
|
|
|
|
|
|
|
private List<MultiplayerRoomUser> users = new List<MultiplayerRoomUser>();
|
|
|
|
|
|
|
|
public void Join(int user) => users.Add(new MultiplayerRoomUser(user));
|
|
|
|
|
|
|
|
public void Leave(int user) => users.RemoveAll(u => u.UserID == user);
|
2020-12-04 14:34:31 +08:00
|
|
|
}
|
|
|
|
}
|