Added missing documentation to the source code in the Playdate bindings target.
CI / Build & test (macOS) (push) Has been cancelled
CI / Embedded Swift cross-compile (push) Has been cancelled
Documentation / deploy (push) Has been cancelled

This commit is contained in:
2026-07-25 12:55:53 +02:00
parent b435a6e8bd
commit 91783deb7b
63 changed files with 259 additions and 3 deletions
@@ -1,8 +1,13 @@
internal import CPlaydate
/// The cached `playdate->scoreboards` C API table.
var scoreboardsAPI: UnsafePointer<playdate_scoreboards> { Playdate.scoreboardsAPI.unsafelyUnwrapped }
/// The scoreboards API for games with online leaderboards.
///
/// The C callbacks carry no userdata, so one completion per operation kind
/// is tracked at a time; starting a second request of the same kind before
/// the first completes replaces the stored completion.
public enum Scoreboards {}
extension Scoreboards {
@@ -3,7 +3,9 @@ internal import CPlaydate
extension Scoreboards {
/// A board belonging to the game.
public struct Board {
/// The board's identifier, used in the other scoreboard calls.
public let boardID: String
/// The board's display name.
public let name: String
init(_ board: PDBoard) {
@@ -3,7 +3,9 @@ internal import CPlaydate
extension Scoreboards {
/// The game's boards.
public struct BoardsList {
/// When the list was last updated, in seconds since the epoch.
public let lastUpdated: UInt32
/// The game's boards.
public let boards: [Board]
init(_ list: PDBoardsList) {
@@ -3,9 +3,13 @@ internal import CPlaydate
extension Scoreboards {
/// A score on a board.
public struct Score {
/// The score's position on the board, starting at 1.
public let rank: UInt32
/// The score's value.
public let value: UInt32
/// The name of the player who posted the score.
public let player: String
/// The board the score belongs to, when known.
public let boardID: String?
init(_ score: PDScore) {
@@ -3,10 +3,15 @@ internal import CPlaydate
extension Scoreboards {
/// The scores on a board.
public struct ScoresList {
/// The board the scores belong to.
public let boardID: String
/// When the list was last updated, in seconds since the epoch.
public let lastUpdated: UInt32
/// Whether the current player's score is included in the list.
public let playerIncluded: Bool
/// The maximum number of scores the list can hold.
public let limit: UInt32
/// The scores, ordered by rank.
public let scores: [Score]
init(_ list: PDScoresList) {