diff options
| author | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
|---|---|---|
| committer | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
| commit | b691c43c44ff180d10e7d4a9afc83b98551ff586 (patch) | |
| tree | 3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.World/Stat.h | |
| parent | def8cb415354ac390b7e89052a50605285f1aca9 (diff) | |
Initial commit
Diffstat (limited to 'Minecraft.World/Stat.h')
| -rw-r--r-- | Minecraft.World/Stat.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/Minecraft.World/Stat.h b/Minecraft.World/Stat.h new file mode 100644 index 00000000..3c2ab071 --- /dev/null +++ b/Minecraft.World/Stat.h @@ -0,0 +1,61 @@ +#pragma once +using namespace std; + +#include "StatFormatter.h" +#include "GenericStats.h" + +class DecimalFormat; + +class Stat +{ +public: + const int id; + const wstring name; + bool awardLocallyOnly; + +private: + const StatFormatter *formatter; + void _init(); + +public: + Stat(int id, const wstring& name, StatFormatter *formatter); + Stat(int id, const wstring& name); + Stat *setAwardLocallyOnly(); + + virtual Stat *postConstruct(); + virtual bool isAchievement(); + wstring format(int value); + +private: + //static NumberFormat *numberFormat; + +public: + class DefaultFormat : public StatFormatter + { + public: + wstring format(int value); + } static *defaultFormatter; + +private: + static DecimalFormat *decimalFormat; + +public: + + class TimeFormatter : public StatFormatter + { + public: + wstring format(int value); + } static *timeFormatter; + + class DistanceFormatter : public StatFormatter + { + public: + wstring format(int cm); + } static *distanceFormatter; + + wstring toString(); + +public: + // 4J-JEV, for Durango stats + virtual void handleParamBlob(shared_ptr<LocalPlayer> plr, byteArray param) { app.DebugPrintf("'Stat.h', Unhandled AwardStat blob.\n"); return; } +}; |
