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