Skip to content

Commit

Permalink
CHANGE deduplicate scoreBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
ninovanhooff committed Oct 24, 2024
1 parent 5600a4e commit ce8fe96
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/playdate/scoreboards.nim
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,16 @@ proc newPDBoardsList(lastUpdated: uint32, boards: seq[PDBoard]): PDBoardsList =
PDBoardsList(lastUpdated: lastUpdated, boards: boards)
let emptyPDBoardsList = newPDBoardsList(lastUpdated = 0, boards = @[])

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

proc scoreBuilder(score: PDScoreRaw): 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 ce8fe96

Please sign in to comment.