2021-10-20 12:08:58 +00:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
#nullable enable
|
|
|
|
|
2021-11-10 09:25:14 +00:00
|
|
|
using System;
|
2021-10-20 12:08:58 +00:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using MessagePack;
|
|
|
|
using osu.Game.Online.API;
|
|
|
|
|
2021-10-22 07:48:28 +00:00
|
|
|
namespace osu.Game.Online.Rooms
|
2021-10-20 12:08:58 +00:00
|
|
|
{
|
2021-11-10 09:25:14 +00:00
|
|
|
[Serializable]
|
|
|
|
[MessagePackObject]
|
2021-11-15 14:14:27 +00:00
|
|
|
public class MultiplayerPlaylistItem
|
2021-10-20 12:08:58 +00:00
|
|
|
{
|
|
|
|
[Key(0)]
|
2021-10-22 07:48:28 +00:00
|
|
|
public long ID { get; set; }
|
2021-10-20 12:08:58 +00:00
|
|
|
|
|
|
|
[Key(1)]
|
2021-11-16 05:37:54 +00:00
|
|
|
public int OwnerID { get; set; }
|
2021-10-20 12:08:58 +00:00
|
|
|
|
|
|
|
[Key(2)]
|
2021-11-12 15:22:48 +00:00
|
|
|
public int BeatmapID { get; set; }
|
2021-10-20 12:08:58 +00:00
|
|
|
|
|
|
|
[Key(3)]
|
2021-11-12 15:22:48 +00:00
|
|
|
public string BeatmapChecksum { get; set; } = string.Empty;
|
2021-10-20 12:08:58 +00:00
|
|
|
|
|
|
|
[Key(4)]
|
2021-11-12 15:22:48 +00:00
|
|
|
public int RulesetID { get; set; }
|
2021-10-22 07:48:28 +00:00
|
|
|
|
|
|
|
[Key(5)]
|
2021-11-12 15:22:48 +00:00
|
|
|
public IEnumerable<APIMod> RequiredMods { get; set; } = Enumerable.Empty<APIMod>();
|
2021-10-22 07:48:28 +00:00
|
|
|
|
2021-10-22 12:25:49 +00:00
|
|
|
[Key(6)]
|
2021-11-12 15:22:48 +00:00
|
|
|
public IEnumerable<APIMod> AllowedMods { get; set; } = Enumerable.Empty<APIMod>();
|
|
|
|
|
|
|
|
[Key(7)]
|
2021-10-22 12:25:49 +00:00
|
|
|
public bool Expired { get; set; }
|
|
|
|
|
2021-12-02 10:15:27 +00:00
|
|
|
/// <summary>
|
|
|
|
/// The order in which this <see cref="MultiplayerPlaylistItem"/> will be played, starting from 0 and increasing for items which will be played later.
|
|
|
|
/// </summary>
|
|
|
|
/// <remarks>
|
|
|
|
/// Undefined value for items which are expired.
|
|
|
|
/// </remarks>
|
|
|
|
[Key(8)]
|
|
|
|
public int GameplayOrder { get; set; }
|
|
|
|
|
2021-11-15 14:14:27 +00:00
|
|
|
public MultiplayerPlaylistItem()
|
2021-10-22 07:48:28 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-11-15 14:14:27 +00:00
|
|
|
public MultiplayerPlaylistItem(PlaylistItem item)
|
2021-10-22 07:48:28 +00:00
|
|
|
{
|
|
|
|
ID = item.ID;
|
|
|
|
BeatmapID = item.BeatmapID;
|
|
|
|
BeatmapChecksum = item.Beatmap.Value?.MD5Hash ?? string.Empty;
|
|
|
|
RulesetID = item.RulesetID;
|
|
|
|
RequiredMods = item.RequiredMods.Select(m => new APIMod(m)).ToArray();
|
|
|
|
AllowedMods = item.AllowedMods.Select(m => new APIMod(m)).ToArray();
|
2021-10-22 12:25:49 +00:00
|
|
|
Expired = item.Expired;
|
2021-12-02 10:15:27 +00:00
|
|
|
GameplayOrder = item.GameplayOrder;
|
2021-10-22 07:48:28 +00:00
|
|
|
}
|
2021-10-20 12:08:58 +00:00
|
|
|
}
|
|
|
|
}
|