Sort rooms based on their API position

This commit is contained in:
smoogipoo
2018-12-28 01:45:19 +09:00
parent f21b784493
commit a7db0bbb91
6 changed files with 44 additions and 2 deletions

View File

@ -79,6 +79,12 @@ namespace osu.Game.Online.Multiplayer
set => MaxAttempts.Value = value;
}
/// <summary>
/// The position of this <see cref="Room"/> in the list. This is not read from or written to the API.
/// </summary>
[JsonIgnore]
public int Position = -1;
public void CopyFrom(Room other)
{
RoomID.Value = other.RoomID;
@ -103,6 +109,8 @@ namespace osu.Game.Online.Multiplayer
Playlist.AddRange(other.Playlist);
else if (other.Playlist.Count > 0)
Playlist.First().ID = other.Playlist.First().ID;
Position = other.Position;
}
public bool ShouldSerializeRoomID() => false;