Path: blob/master/RSDKv5/RSDK/User/Core/UserStats.hpp
1163 views
#ifndef USER_STATS_H1#define USER_STATS_H23#include <vector>45namespace RSDK6{7namespace SKU8{910#if RETRO_REV0211struct StatInfo {12uint8 statID;13const char *name;14void *data[64];15};1617// This is the base struct, it serves as the base for any API-specific stats18// This struct should never be removed19struct UserStats {20virtual ~UserStats() = default;2122virtual void StageLoad() { enabled = true; }23virtual void FrameInit() {}24virtual void OnUnknownEvent() {}25virtual void TryTrackStat(StatInfo *stat) {}2627bool32 enabled = true;28};2930extern UserStats *stats;3132// ====================33// API Cores34// ====================3536// Dummy API37#if RETRO_USERCORE_DUMMY38#include "RSDK/User/Dummy/DummyStats.hpp"39#endif4041// Steam API42#if RETRO_USERCORE_STEAM43#include "RSDK/User/Steam/SteamStats.hpp"44#endif4546// Epic Games API47#if RETRO_USERCORE_EOS48#include "RSDK/User/EOS/EOSStats.hpp"49#endif5051// Switch API52#if RETRO_USERCORE_NX53#include "RSDK/User/NX/NXStats.hpp"54#endif5556#endif5758// Rev01 ver of TrackStat stuff basically59#if !RETRO_REV0260void TrackActClear(uint8 zoneID, uint8 actID, uint8 characterID, int32 time, int32 rings, int32 score);61void TrackTAClear(uint8 zoneID, uint8 actID, uint8 characterID, int32 time);62void TrackEnemyDefeat(uint8 zoneID, uint8 actID, uint8 characterID, int32 entityX, int32 entityY);63void TrackGameProgress(float percent);64#else65inline void TryTrackStat(StatInfo *stat) { stats->TryTrackStat(stat); }66inline bool32 GetStatsEnabled() { return stats->enabled; }67inline void SetStatsEnabled(bool32 enabled) { stats->enabled = enabled; }68#endif6970} // namespace SKU71} // namespace RSDK7273#endif // USER_STATS_H747576