1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 12:42:54 +08:00
osu-lazer/osu.Game/Online/Spectator/SpectatorState.cs
2020-10-22 17:48:15 +09:00

30 lines
873 B
C#

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using osu.Game.Online.API;
using osu.Game.Rulesets.Mods;
namespace osu.Game.Online.Spectator
{
[Serializable]
public class SpectatorState : IEquatable<SpectatorState>
{
public int? BeatmapID { get; set; }
[NotNull]
public IEnumerable<APIMod> Mods { get; set; } = Enumerable.Empty<APIMod>();
public SpectatorState(int? beatmapId = null, IEnumerable<APIMod> mods = null)
{
BeatmapID = beatmapId;
if (mods != null)
Mods = mods;
}
public bool Equals(SpectatorState other) => this.BeatmapID == other?.BeatmapID && this.Mods.SequenceEqual(other?.Mods);
public override string ToString() => $"Beatmap:{BeatmapID} Mods:{string.Join(',', Mods)}";
}
}