DocC documentation support (#4)

This PR contains the work done to:
* Documented all the `private`, `internal`, and `public` interfaces on the existing codebase;
* Set the DocC documentation catalog in the project;
* Written the main `Library` article for the DocC documentation catalog;
* Added the documentation tasks in the `Makefile` file.

Reviewed-on: #4
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
This commit was merged in pull request #4.
This commit is contained in:
2025-09-09 17:30:19 +00:00
committed by Javier Cicchelli
parent 39c6d6e8d6
commit 37c0f3e322
30 changed files with 543 additions and 151 deletions
+26 -2
View File
@@ -12,23 +12,45 @@
import Foundation
/// A model that represents an amiibo item.
public struct Amiibo: Sendable {
// MARK: Properties
/// A game character.
public let gameCharacter: String
/// A game series.
public let gameSeries: String
/// The first 8 hexadecimal characters of an identifier.
public let head: String
/// An image link.
public let image: String
/// An amiibo name.
public let name: String
/// A game platform type, if any.
public let platform: Platform?
/// A release date.
public let release: Release
/// An amiibo series.
public let series: String
/// The last 8 hexadecimal characters of an identifier.
public let tail: String
/// An amiibo type.
public let type: String
// MARK: Initialisers
// MARK: Initializers
/// Initializes this model from a given payload.
/// - Parameter payload: A payload that contains the values for the model.
init(_ payload: Components.Schemas.Amiibo) {
self.gameCharacter = payload.character
self.gameSeries = payload.gameSeries
@@ -48,10 +70,12 @@ public struct Amiibo: Sendable {
// MARK: Computed
/// An identifier.
public var identifier: String {
head + tail
}
/// A URL related to an image link, if any.
public var imageURL: URL? {
.init(string: image)
}
+10 -2
View File
@@ -11,16 +11,24 @@
//===----------------------------------------------------------------------===
extension Amiibo {
/// A model that represents a game related to an amiibo item.
public struct Game: Sendable {
// MARK: Properties
/// A list of identifiers.
public let identifiers: [String]
/// A name.
public let name: String
/// A list of amiibo usages, if any.
public let usages: [Usage]?
// MARK: Initialisers
// MARK: Initializers
/// Initializes this model from a given payload.
/// - Parameter payload: A payload that contains the values for the model.
init(_ payload: Components.Schemas.AmiiboGame) {
self.identifiers = payload.gameID
self.name = payload.gameName
@@ -11,16 +11,30 @@
//===----------------------------------------------------------------------===
extension Amiibo {
/// A model that represents a collection of `WiiU`, `3DS`, and `Switch` games related to an amiibo item.
public struct Platform: Sendable {
// MARK: Properties
/// A list of `Switch` games related to an amiibo item.
public let `switch`: [Game]
/// A list of `3DS` games related to an amiibo item.
public let threeDS: [Game]
/// A list of `WiiU` games related to an amiibo item.
public let wiiU: [Game]
// MARK: Initialisers
/// Initializes this model.
///
/// > important: In case no data is provided, then an instance of this model is not created.
///
/// - Parameters:
/// - `switch`: A list of `Switch` games related to an amiibo item, if any.
/// - threeDS: A list of `3DS` games related to an amiibo item, if any.
/// - wiiU: A list of `WiiU` games related to an amiibo item, if any.
init?(
_ `switch`: [Components.Schemas.AmiiboGame]?,
_ threeDS: [Components.Schemas.AmiiboGame]?,
@@ -13,17 +13,27 @@
import Foundation
extension Amiibo {
/// A model that represents a collection of release dates related to an amiibo item.
public struct Release: Sendable {
// MARK: Properties
/// A release date for North America, if any.
public let america: Date?
/// A release date for Australia, if any.
public let australia: Date?
/// A release date for Europe, if any.
public let europe: Date?
/// A release date for Japan, if any.
public let japan: Date?
// MARK: Initialisers
// MARK: Initializers
/// Initializes this model from a given payload.
/// - Parameter payload: A payload that contains the values for the model.
init(_ payload: Components.Schemas.AmiiboRelease) {
self.america = payload.na
self.australia = payload.au
@@ -11,15 +11,21 @@
//===----------------------------------------------------------------------===
extension Amiibo {
/// A model that represents the usage of an amiibo item within a certain game.
public struct Usage: Sendable {
// MARK: Properties
/// An explanation of how to use an amiibo item.
public let explanation: String
/// A flag that indicates whether an amiibo item can save game data in it.
public let isWriteable: Bool
// MARK: Initialisers
// MARK: Initializers
/// Initializes this model from a given payload.
/// - Parameter payload: A payload that contains the values for the model.
init(_ payload: Components.Schemas.AmiiboUsage) {
self.explanation = payload.Usage
self.isWriteable = payload.write
+2 -1
View File
@@ -10,6 +10,7 @@
//
//===----------------------------------------------------------------------===
/// A model that represents an amiibo series.
public struct AmiiboSeries: KeyNameModel {
// MARK: Properties
@@ -17,7 +18,7 @@ public struct AmiiboSeries: KeyNameModel {
public let key: String
public let name: String
// MARK: Initialisers
// MARK: Initializers
init(_ payload: Components.Schemas.Tuple) {
self.key = payload.key
+2 -1
View File
@@ -10,6 +10,7 @@
//
//===----------------------------------------------------------------------===
/// A model that represents an amiibo type.
public struct AmiiboType: KeyNameModel {
// MARK: Properties
@@ -17,7 +18,7 @@ public struct AmiiboType: KeyNameModel {
public let key: String
public let name: String
// MARK: Initialisers
// MARK: Initializers
init(_ payload: Components.Schemas.Tuple) {
self.key = payload.key
+2 -1
View File
@@ -10,6 +10,7 @@
//
//===----------------------------------------------------------------------===
/// A model that represents a game character.
public struct GameCharacter: KeyNameModel {
// MARK: Properties
@@ -17,7 +18,7 @@ public struct GameCharacter: KeyNameModel {
public let key: String
public let name: String
// MARK: Initialisers
// MARK: Initializers
init(_ payload: Components.Schemas.Tuple) {
self.key = payload.key
+2 -1
View File
@@ -10,6 +10,7 @@
//
//===----------------------------------------------------------------------===
/// A model that represents a game series.
public struct GameSeries: KeyNameModel {
// MARK: Properties
@@ -17,7 +18,7 @@ public struct GameSeries: KeyNameModel {
public let key: String
public let name: String
// MARK: Initialisers
// MARK: Initializers
init(_ payload: Components.Schemas.Tuple) {
self.key = payload.key