1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 15:03:13 +08:00

Make TestRoomManager update existing room

This commit is contained in:
smoogipoo 2021-08-16 12:43:09 +09:00
parent 1c0ffd4621
commit 76a8d4329f

View File

@ -38,7 +38,13 @@ namespace osu.Game.Tests.Visual.OnlinePlay
public void AddOrUpdateRoom(Room room)
{
Rooms.Add(room);
var existing = Rooms.FirstOrDefault(r => r.RoomID.Value != null && r.RoomID.Value == room.RoomID.Value);
if (existing != null)
existing.CopyFrom(room);
else
Rooms.Add(room);
RoomsUpdated?.Invoke();
}