Skip to content

Commit

Permalink
combine scorebuilder procs
Browse files Browse the repository at this point in the history
  • Loading branch information
ninovanhooff committed Oct 25, 2024
1 parent 43b06ba commit 7cf18e7
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/playdate/scoreboards.nim
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,13 @@ proc newPDBoardsList(lastUpdated: uint32, boards: seq[PDBoard]): PDBoardsList =
PDBoardsList(lastUpdated: lastUpdated, boards: boards)
let emptyPDBoardsList = newPDBoardsList(lastUpdated = 0, boards = @[])

proc scoreBuilder(score: PDScoreRaw): PDScore =
proc scoreBuilder(score: PDScoreRaw | PDScorePtr): PDScore =
newPDScore(
value = score.value.uint32,
rank = score.rank.uint32,
player = $score.player
)

proc scoreBuilder(score: PDScorePtr): PDScore =
scoreBuilder(score[])

proc invokePersonalBestCallback(score: PDScorePtr, errorMessage: ConstChar) {.cdecl, raises: [].} =
invokeCallback(
callbackSeqs = privatePersonalBestCallbacks,
Expand Down

0 comments on commit 7cf18e7

Please sign in to comment.