Flipper Zero Firmware
Loading...
Searching...
No Matches
dolphin_state.h
1#pragma once
2
3#include "dolphin_deed.h"
4#include <stdbool.h>
5#include <stdint.h>
6#include <time.h>
7
8typedef struct DolphinState DolphinState;
9typedef struct {
10 uint8_t icounter_daily_limit[DolphinAppMAX];
11 uint8_t butthurt_daily_limit;
12
13 uint32_t flags;
14 uint32_t icounter;
15 int32_t butthurt;
16 uint64_t timestamp;
18
21 bool dirty;
22};
23
24DolphinState* dolphin_state_alloc(void);
25
26void dolphin_state_free(DolphinState* dolphin_state);
27
28bool dolphin_state_save(DolphinState* dolphin_state);
29
30bool dolphin_state_load(DolphinState* dolphin_state);
31
32void dolphin_state_clear_limits(DolphinState* dolphin_state);
33
34uint64_t dolphin_state_timestamp(void);
35
36void dolphin_state_on_deed(DolphinState* dolphin_state, DolphinDeed deed);
37
38void dolphin_state_butthurted(DolphinState* dolphin_state);
39
40uint32_t dolphin_state_xp_to_levelup(uint32_t icounter);
41
42uint32_t dolphin_state_xp_above_last_levelup(uint32_t icounter);
43
44bool dolphin_state_is_levelup(uint32_t icounter);
45
46void dolphin_state_increase_level(DolphinState* dolphin_state);
47
48uint8_t dolphin_get_level(uint32_t icounter);
Definition dolphin_state.h:19
Definition dolphin_state.h:9