2020-12-18 20:15:29 +00:00
|
|
|
#pragma once
|
|
|
|
|
2021-11-24 16:21:12 +00:00
|
|
|
#include "furi/pubsub.h"
|
2022-01-02 21:39:56 +00:00
|
|
|
#include "gui/view.h"
|
2021-09-28 09:40:39 +00:00
|
|
|
#include "helpers/dolphin_deed.h"
|
2021-11-24 16:21:12 +00:00
|
|
|
#include <stdbool.h>
|
2020-12-18 20:15:29 +00:00
|
|
|
|
|
|
|
typedef struct Dolphin Dolphin;
|
|
|
|
|
2021-09-30 19:50:58 +00:00
|
|
|
typedef struct {
|
|
|
|
uint32_t icounter;
|
|
|
|
uint32_t butthurt;
|
2021-10-07 13:32:37 +00:00
|
|
|
uint64_t timestamp;
|
2021-11-24 16:21:12 +00:00
|
|
|
uint8_t level;
|
|
|
|
bool level_up_is_pending;
|
2021-09-30 19:50:58 +00:00
|
|
|
} DolphinStats;
|
2021-09-28 09:40:39 +00:00
|
|
|
|
2021-11-24 16:21:12 +00:00
|
|
|
typedef enum {
|
|
|
|
DolphinPubsubEventUpdate,
|
|
|
|
} DolphinPubsubEvent;
|
|
|
|
|
2021-09-30 19:50:58 +00:00
|
|
|
/** Deed complete notification. Call it on deed completion.
|
2020-12-18 20:15:29 +00:00
|
|
|
* See dolphin_deed.h for available deeds. In futures it will become part of assets.
|
2021-09-30 19:50:58 +00:00
|
|
|
* Thread safe, async
|
2020-12-18 20:15:29 +00:00
|
|
|
*/
|
|
|
|
void dolphin_deed(Dolphin* dolphin, DolphinDeed deed);
|
2021-09-28 09:40:39 +00:00
|
|
|
|
2021-09-30 19:50:58 +00:00
|
|
|
/** Retrieve dolphin stats
|
|
|
|
* Thread safe, blocking
|
2021-09-28 09:40:39 +00:00
|
|
|
*/
|
2021-09-30 19:50:58 +00:00
|
|
|
DolphinStats dolphin_stats(Dolphin* dolphin);
|
2021-09-28 09:40:39 +00:00
|
|
|
|
2021-09-30 19:50:58 +00:00
|
|
|
/** Flush dolphin queue and save state
|
|
|
|
* Thread safe, blocking
|
2021-09-28 09:40:39 +00:00
|
|
|
*/
|
2021-11-24 16:21:12 +00:00
|
|
|
void dolphin_flush(Dolphin* dolphin);
|
|
|
|
|
|
|
|
void dolphin_upgrade_level(Dolphin* dolphin);
|
|
|
|
|
|
|
|
FuriPubSub* dolphin_get_pubsub(Dolphin* dolphin);
|