Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Rubberduckycooly
GitHub Repository: Rubberduckycooly/RSDKv5-Decompilation
Path: blob/master/RSDKv5/RSDK/User/Core/UserStats.hpp
1163 views
1
#ifndef USER_STATS_H
2
#define USER_STATS_H
3
4
#include <vector>
5
6
namespace RSDK
7
{
8
namespace SKU
9
{
10
11
#if RETRO_REV02
12
struct StatInfo {
13
uint8 statID;
14
const char *name;
15
void *data[64];
16
};
17
18
// This is the base struct, it serves as the base for any API-specific stats
19
// This struct should never be removed
20
struct UserStats {
21
virtual ~UserStats() = default;
22
23
virtual void StageLoad() { enabled = true; }
24
virtual void FrameInit() {}
25
virtual void OnUnknownEvent() {}
26
virtual void TryTrackStat(StatInfo *stat) {}
27
28
bool32 enabled = true;
29
};
30
31
extern UserStats *stats;
32
33
// ====================
34
// API Cores
35
// ====================
36
37
// Dummy API
38
#if RETRO_USERCORE_DUMMY
39
#include "RSDK/User/Dummy/DummyStats.hpp"
40
#endif
41
42
// Steam API
43
#if RETRO_USERCORE_STEAM
44
#include "RSDK/User/Steam/SteamStats.hpp"
45
#endif
46
47
// Epic Games API
48
#if RETRO_USERCORE_EOS
49
#include "RSDK/User/EOS/EOSStats.hpp"
50
#endif
51
52
// Switch API
53
#if RETRO_USERCORE_NX
54
#include "RSDK/User/NX/NXStats.hpp"
55
#endif
56
57
#endif
58
59
// Rev01 ver of TrackStat stuff basically
60
#if !RETRO_REV02
61
void TrackActClear(uint8 zoneID, uint8 actID, uint8 characterID, int32 time, int32 rings, int32 score);
62
void TrackTAClear(uint8 zoneID, uint8 actID, uint8 characterID, int32 time);
63
void TrackEnemyDefeat(uint8 zoneID, uint8 actID, uint8 characterID, int32 entityX, int32 entityY);
64
void TrackGameProgress(float percent);
65
#else
66
inline void TryTrackStat(StatInfo *stat) { stats->TryTrackStat(stat); }
67
inline bool32 GetStatsEnabled() { return stats->enabled; }
68
inline void SetStatsEnabled(bool32 enabled) { stats->enabled = enabled; }
69
#endif
70
71
} // namespace SKU
72
} // namespace RSDK
73
74
#endif // USER_STATS_H
75
76