AmiiboApi.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text.Json.Serialization;
  4. namespace Ryujinx.Ui.Common.Models.Amiibo
  5. {
  6. public struct AmiiboApi : IEquatable<AmiiboApi>
  7. {
  8. [JsonPropertyName("name")]
  9. public string Name { get; set; }
  10. [JsonPropertyName("head")]
  11. public string Head { get; set; }
  12. [JsonPropertyName("tail")]
  13. public string Tail { get; set; }
  14. [JsonPropertyName("image")]
  15. public string Image { get; set; }
  16. [JsonPropertyName("amiiboSeries")]
  17. public string AmiiboSeries { get; set; }
  18. [JsonPropertyName("character")]
  19. public string Character { get; set; }
  20. [JsonPropertyName("gameSeries")]
  21. public string GameSeries { get; set; }
  22. [JsonPropertyName("type")]
  23. public string Type { get; set; }
  24. [JsonPropertyName("release")]
  25. public Dictionary<string, string> Release { get; set; }
  26. [JsonPropertyName("gamesSwitch")]
  27. public List<AmiiboApiGamesSwitch> GamesSwitch { get; set; }
  28. public override string ToString()
  29. {
  30. return Name;
  31. }
  32. public string GetId()
  33. {
  34. return Head + Tail;
  35. }
  36. public bool Equals(AmiiboApi other)
  37. {
  38. return Head + Tail == other.Head + other.Tail;
  39. }
  40. public override bool Equals(object obj)
  41. {
  42. return obj is AmiiboApi other && Equals(other);
  43. }
  44. public override int GetHashCode()
  45. {
  46. return HashCode.Combine(Head, Tail);
  47. }
  48. }
  49. }