mirror of
https://github.com/ppy/osu.git
synced 2025-01-18 11:02:57 +08:00
Add BeatmapSetId to playlist items
This commit is contained in:
parent
a99a992ceb
commit
9abb92a8d6
@ -56,6 +56,9 @@ namespace osu.Game.Online.Rooms
|
||||
[Key(10)]
|
||||
public double StarRating { get; set; }
|
||||
|
||||
[Key(11)]
|
||||
public int? BeatmapSetID { get; set; }
|
||||
|
||||
[SerializationConstructor]
|
||||
public MultiplayerPlaylistItem()
|
||||
{
|
||||
|
@ -67,6 +67,9 @@ namespace osu.Game.Online.Rooms
|
||||
set => Beatmap = new APIBeatmap { OnlineID = value };
|
||||
}
|
||||
|
||||
[JsonProperty("beatmapset_id")]
|
||||
public int? BeatmapSetId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A beatmap representing this playlist item.
|
||||
/// In many cases, this will *not* contain any usable information apart from OnlineID.
|
||||
@ -101,6 +104,7 @@ namespace osu.Game.Online.Rooms
|
||||
PlayedAt = item.PlayedAt;
|
||||
RequiredMods = item.RequiredMods.ToArray();
|
||||
AllowedMods = item.AllowedMods.ToArray();
|
||||
BeatmapSetId = item.BeatmapSetID;
|
||||
}
|
||||
|
||||
public void MarkInvalid() => valid.Value = false;
|
||||
@ -133,12 +137,14 @@ namespace osu.Game.Online.Rooms
|
||||
AllowedMods = AllowedMods,
|
||||
RequiredMods = RequiredMods,
|
||||
valid = { Value = Valid.Value },
|
||||
BeatmapSetId = BeatmapSetId
|
||||
};
|
||||
}
|
||||
|
||||
public bool Equals(PlaylistItem? other)
|
||||
=> ID == other?.ID
|
||||
&& Beatmap.OnlineID == other.Beatmap.OnlineID
|
||||
&& BeatmapSetId == other.BeatmapSetId
|
||||
&& RulesetID == other.RulesetID
|
||||
&& Expired == other.Expired
|
||||
&& PlaylistOrder == other.PlaylistOrder
|
||||
|
@ -83,6 +83,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||
{
|
||||
ID = itemToEdit?.ID ?? 0,
|
||||
BeatmapID = item.Beatmap.OnlineID,
|
||||
BeatmapSetID = item.BeatmapSetId,
|
||||
BeatmapChecksum = item.Beatmap.MD5Hash,
|
||||
RulesetID = item.RulesetID,
|
||||
RequiredMods = item.RequiredMods.ToArray(),
|
||||
|
Loading…
Reference in New Issue
Block a user