34#define MAX_HIGH_SCORE_COUNT 20
bool updateHighScores(highScores_t *hs, const char *nvsNamespace, score_t newScores[], uint8_t numNewScores)
Update the high score table and user high score with new scores from the player or SwadgePass and per...
Definition highScores.c:22
#define MAX_HIGH_SCORE_COUNT
Definition highScores.h:34
int32_t userHighScore
Definition highScores.h:50
int32_t score
The point value of this score. This will be 0 for uninitialized scores.
Definition highScores.h:39
score_t highScores[MAX_HIGH_SCORE_COUNT]
High score list, sorted from high to low.
Definition highScores.h:52
void saveHighScoresFromSwadgePass(highScores_t *hs, const char *nvsNamespace, list_t swadgePasses, int32_t(*fnGetSwadgePassHighScore)(const swadgePassPacket_t *packet))
Extract high score data received from SwadgePass and save to the high score table....
Definition highScores.c:102
void addHighScoreToSwadgePassPacket(const char *nvsNamespace, swadgePassPacket_t *packet, void(*fnSetSwadgePassHighScore)(swadgePassPacket_t *packet, int32_t highScore))
Write high score data to SwadgePass packet for sending to other swadges. This should be called from y...
Definition highScores.c:122
void initHighScores(highScores_t *hs, const char *nvsNamespace)
Load high score data from NVS.
Definition highScores.c:15
uint8_t highScoreCount
Number of high scores to save. Defaults to MAX_HIGH_SCORE_COUNT if not set.
Definition highScores.h:47
int32_t swadgePassUsername
The SwadgePass user who achieved this score, or 0 for this Swadge's user.
Definition highScores.h:41
Definition highScores.h:45
Definition highScores.h:37
A doubly linked list with pointers to the first and last nodes.
Definition linked_list.h:87
struct swadgePassPacket swadgePassPacket_t
A SwadgePass packet which is transmitted over ESP NOW.