osu/osu.Game/Online/Spectator/SpectatorState.cs

27 lines
880 B
C#
Raw Normal View History

2020-10-22 10:41:10 +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.
2020-10-22 08:29:38 +00:00
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
2020-10-22 08:38:16 +00:00
using osu.Game.Online.API;
2020-10-22 08:29:38 +00:00
namespace osu.Game.Online.Spectator
{
[Serializable]
public class SpectatorState : IEquatable<SpectatorState>
{
public int? BeatmapID { get; set; }
2020-10-23 08:24:19 +00:00
public int? RulesetID { get; set; }
2020-10-22 08:29:38 +00:00
[NotNull]
2020-10-22 08:38:16 +00:00
public IEnumerable<APIMod> Mods { get; set; } = Enumerable.Empty<APIMod>();
2020-10-22 08:29:38 +00:00
2020-10-23 08:24:19 +00:00
public bool Equals(SpectatorState other) => BeatmapID == other?.BeatmapID && Mods.SequenceEqual(other?.Mods) && RulesetID == other?.RulesetID;
2020-10-22 08:29:38 +00:00
2020-10-23 08:24:19 +00:00
public override string ToString() => $"Beatmap:{BeatmapID} Mods:{string.Join(',', Mods)} Ruleset:{RulesetID}";
2020-10-22 08:29:38 +00:00
}
}