Fix unable to copy playlist rooms without first opening

This commit is contained in:
Dan Balasescu
2022-03-09 15:38:00 +09:00
parent affcf5180b
commit b07a1e8d09
3 changed files with 41 additions and 19 deletions

View File

@ -10,12 +10,11 @@ using osu.Game.IO.Serialization.Converters;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Multiplayer;
using osu.Game.Online.Rooms.RoomStatuses;
using osu.Game.Utils;
namespace osu.Game.Online.Rooms
{
[JsonObject(MemberSerialization.OptIn)]
public class Room : IDeepCloneable<Room>
public class Room
{
[Cached]
[JsonProperty("id")]
@ -153,22 +152,6 @@ namespace osu.Game.Online.Rooms
Password.BindValueChanged(p => HasPassword.Value = !string.IsNullOrEmpty(p.NewValue));
}
/// <summary>
/// Create a copy of this room without online information.
/// Should be used to create a local copy of a room for submitting in the future.
/// </summary>
public Room DeepClone()
{
var copy = new Room();
copy.CopyFrom(this);
// ID must be unset as we use this as a marker for whether this is a client-side (not-yet-created) room or not.
copy.RoomID.Value = null;
return copy;
}
public void CopyFrom(Room other)
{
RoomID.Value = other.RoomID.Value;