2021-10-20 20:08:58 +08: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
|
|
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using MessagePack;
|
|
|
|
using osu.Game.Online.API;
|
|
|
|
|
2021-10-22 15:48:28 +08:00
|
|
|
namespace osu.Game.Online.Rooms
|
2021-10-20 20:08:58 +08:00
|
|
|
{
|
2021-10-22 15:48:28 +08:00
|
|
|
public class APIPlaylistItem
|
2021-10-20 20:08:58 +08:00
|
|
|
{
|
|
|
|
[Key(0)]
|
2021-10-22 15:48:28 +08:00
|
|
|
public long ID { get; set; }
|
2021-10-20 20:08:58 +08:00
|
|
|
|
|
|
|
[Key(1)]
|
2021-10-22 15:48:28 +08:00
|
|
|
public int BeatmapID { get; set; }
|
2021-10-20 20:08:58 +08:00
|
|
|
|
|
|
|
[Key(2)]
|
|
|
|
public string BeatmapChecksum { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
[Key(3)]
|
2021-10-22 15:48:28 +08:00
|
|
|
public int RulesetID { get; set; }
|
2021-10-20 20:08:58 +08:00
|
|
|
|
|
|
|
[Key(4)]
|
2021-10-22 15:48:28 +08:00
|
|
|
public IEnumerable<APIMod> RequiredMods { get; set; } = Enumerable.Empty<APIMod>();
|
|
|
|
|
|
|
|
[Key(5)]
|
2021-10-20 20:08:58 +08:00
|
|
|
public IEnumerable<APIMod> AllowedMods { get; set; } = Enumerable.Empty<APIMod>();
|
2021-10-22 15:48:28 +08:00
|
|
|
|
2021-10-22 20:25:49 +08:00
|
|
|
[Key(6)]
|
|
|
|
public bool Expired { get; set; }
|
|
|
|
|
2021-10-22 15:48:28 +08:00
|
|
|
public APIPlaylistItem()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public APIPlaylistItem(PlaylistItem item)
|
|
|
|
{
|
|
|
|
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 20:25:49 +08:00
|
|
|
Expired = item.Expired;
|
2021-10-22 15:48:28 +08:00
|
|
|
}
|
2021-10-20 20:08:58 +08:00
|
|
|
}
|
|
|
|
}
|