wip
This commit is contained in:
@@ -8,5 +8,5 @@ public interface ILobby
|
||||
public bool FindRoomById(string roomId, [MaybeNullWhen(false)] out Room room);
|
||||
public bool FindRoomByMap(string map, [MaybeNullWhen(false)] out Room room);
|
||||
public void Persist(Room room);
|
||||
public void Remove(Room room);
|
||||
public void RemoveIfEmpty(Room room);
|
||||
}
|
||||
@@ -47,11 +47,15 @@ public class LobbyInMemory : ILobby
|
||||
_rooms.Add(room);
|
||||
|
||||
foreach (var r in _rooms)
|
||||
_logger.Trace($"{r.Id} {r.Info}");
|
||||
_logger.Trace($"Room: {r.Id} {r.Info} Players: {r.Players.Count}");
|
||||
}
|
||||
|
||||
public void Remove(Room room)
|
||||
public void RemoveIfEmpty(Room room)
|
||||
{
|
||||
_rooms.Remove(room);
|
||||
if (room.Players.Count == 0)
|
||||
_rooms.Remove(room);
|
||||
|
||||
foreach (var r in _rooms)
|
||||
_logger.Trace($"Room: {r.Id} {r.Info} Players: {r.Players.Count}");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user