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:
parent
1c0ffd4621
commit
76a8d4329f
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user