Made Amiibo models Codable and Identifiable, and filters Hashable.

This commit is contained in:
javier committed 2026-10-25 20:20:41 +01:00
1 parent 8fa4d50734
commit a28842eb0a
24 files changed
+352 -190

No files matched your search

@@ -15,7 +15,7 @@
import Foundation
/// A model that represents an amiibo.
public struct Amiibo: Sendable, Hashable {
public struct Amiibo: Sendable, Hashable, Codable, Identifiable {
// MARK: Properties
@@ -36,7 +36,7 @@ public struct Amiibo: Sendable, Hashable {
/// The related games of this amiibo, grouped by platform.
///
/// This value is `nil` unless the request sets ``AmiiboFilter/showGames`` or ``AmiiboFilter/showUsage``, or when the amiibo has no related games.
/// `nil` unless the request sets ``AmiiboFilter/showGames`` or ``AmiiboFilter/showUsage``, or when there are no related games.
public let platform: Platform?
/// The release dates of this amiibo across different regions.
@@ -99,7 +99,12 @@ public struct Amiibo: Sendable, Hashable {
}
// MARK: Computed
/// The ``identifier`` of this amiibo.
public var id: String {
identifier
}
/// The full 16-character hexadecimal identifier, composed of the ``head`` and ``tail``.
public var identifier: String {
head + tail