34#include "FairyCollection/fairyCollectionData.h"
39#define MAX_HIGH_SCORE_COUNT 20
#define NVS_KEY_NAME_MAX_SIZE
Definition hdw-nvs.h:59
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:24
wsg_t image
The Swadgepass user's rendered profile picture.
Definition highScores.h:75
nameData_t name
The Swadgepass username.
Definition highScores.h:73
void initDisplayHighScores(highScores_t *hs, displayScore_t ds[])
Load the usernames and user images for the high score table into memory. When you are finished with t...
Definition highScores.c:156
#define MAX_HIGH_SCORE_COUNT
Definition highScores.h:39
void clearHighScores(const char *nvsNamespace)
Clear high score data from NVS.
Definition highScores.c:142
char spKey[NVS_KEY_NAME_MAX_SIZE]
Definition highScores.h:47
int32_t userHighScore
Definition highScores.h:62
void freeDisplayHighScores(highScores_t *hs, displayScore_t ds[])
Free memory used for user images.
Definition highScores.c:188
int32_t packedName
Definition highScores.h:50
int32_t score
The point value of this score. This will be 0 for uninitialized scores.
Definition highScores.h:44
score_t highScores[MAX_HIGH_SCORE_COUNT]
High score list, sorted from high to low.
Definition highScores.h:64
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:148
void initHighScores(highScores_t *hs, const char *nvsNamespace)
Load high score data from NVS.
Definition highScores.c:17
uint8_t highScoreCount
Number of high scores to save. Defaults to MAX_HIGH_SCORE_COUNT if not set.
Definition highScores.h:59
fairy_t fairy
Definition highScores.h:53
void saveHighScoresFromSwadgePass(highScores_t *hs, const char *nvsNamespace, list_t swadgePasses, const struct swadgeMode *mode, int32_t(*fnGetSwadgePassHighScore)(const swadgePassPacket_t *packet))
Extract high score data received from SwadgePass and save to the high score table....
Definition highScores.c:104
Struct for displaying the high score table entry. Includes usernames and rendered user images.
Definition highScores.h:69
Definition highScores.h:57
Definition highScores.h:42
A doubly linked list with pointers to the first and last nodes.
Definition linked_list.h:87
Provides index-based usernames that will avoid the issues inherent in free text entry.
struct swadgePassPacket swadgePassPacket_t
A SwadgePass packet which is transmitted over ESP NOW.
A sprite using paletteColor_t colors that can be drawn to the display.
Definition wsg.h:58