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