2024-03-23 16:41:40 +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.
|
|
|
|
|
|
|
|
using System;
|
2024-03-23 23:07:31 +08:00
|
|
|
using System.Linq;
|
2024-03-23 16:41:40 +08:00
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
|
|
namespace osu.Game.Online.API.Requests.Responses
|
|
|
|
{
|
|
|
|
public class APIMenuContent : IEquatable<APIMenuContent>
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Images which should be displayed in rotation.
|
|
|
|
/// </summary>
|
|
|
|
[JsonProperty(@"images")]
|
|
|
|
public APIMenuImage[] Images { get; init; } = Array.Empty<APIMenuImage>();
|
|
|
|
|
|
|
|
public bool Equals(APIMenuContent? other)
|
|
|
|
{
|
|
|
|
if (ReferenceEquals(null, other)) return false;
|
|
|
|
if (ReferenceEquals(this, other)) return true;
|
|
|
|
|
2024-03-23 23:07:31 +08:00
|
|
|
return Images.SequenceEqual(other.Images);
|
2024-03-23 16:41:40 +08:00
|
|
|
}
|
|
|
|
|
2024-03-26 20:21:12 +08:00
|
|
|
public override bool Equals(object? other) => other is APIMenuContent content && Equals(content);
|
2024-03-23 16:41:40 +08:00
|
|
|
|
|
|
|
public override int GetHashCode()
|
|
|
|
{
|
2024-03-23 23:07:31 +08:00
|
|
|
var hash = new HashCode();
|
|
|
|
|
|
|
|
foreach (var image in Images)
|
|
|
|
hash.Add(image.GetHashCode());
|
|
|
|
|
|
|
|
return hash.ToHashCode();
|
2024-03-23 16:41:40 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|