2025-10-07 22:32:54 +00:00
|
|
|
// ===----------------------------------------------------------------------===
|
|
|
|
|
//
|
|
|
|
|
// This source file is part of the Amiibo Service open source project
|
|
|
|
|
//
|
2026-03-22 23:39:48 +00:00
|
|
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
2025-10-07 22:32:54 +00:00
|
|
|
// Licensed under Apache license v2.0
|
|
|
|
|
//
|
2024-09-14 22:26:39 +00:00
|
|
|
// See LICENSE for license information
|
2025-10-07 22:32:54 +00:00
|
|
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
2024-09-14 22:26:39 +00:00
|
|
|
//
|
2025-10-07 22:32:54 +00:00
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
//
|
|
|
|
|
// ===----------------------------------------------------------------------===
|
2024-09-14 22:26:39 +00:00
|
|
|
|
|
|
|
|
extension Amiibo {
|
2025-11-09 20:19:13 +00:00
|
|
|
/// A model that represents the usage of an amiibo within a certain game.
|
2026-03-22 23:39:48 +00:00
|
|
|
public struct Usage: Sendable, Hashable {
|
2024-09-14 22:26:39 +00:00
|
|
|
|
|
|
|
|
// MARK: Properties
|
|
|
|
|
|
2026-03-22 23:39:48 +00:00
|
|
|
/// A description of how the amiibo is used within the game.
|
2024-09-14 22:26:39 +00:00
|
|
|
public let explanation: String
|
|
|
|
|
|
2026-03-22 23:39:48 +00:00
|
|
|
/// A flag that indicates whether the amiibo can save game data.
|
2025-09-09 17:30:19 +00:00
|
|
|
public let isWriteable: Bool
|
2024-09-14 22:26:39 +00:00
|
|
|
|
2025-09-09 17:30:19 +00:00
|
|
|
// MARK: Initializers
|
|
|
|
|
|
|
|
|
|
/// Initializes this model from a given payload.
|
|
|
|
|
/// - Parameter payload: A payload that contains the values for the model.
|
2024-09-14 22:26:39 +00:00
|
|
|
init(_ payload: Components.Schemas.AmiiboUsage) {
|
|
|
|
|
self.explanation = payload.Usage
|
|
|
|
|
self.isWriteable = payload.write
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|