diff options
author | madmaxoft <github@xoft.cz> | 2014-05-18 23:10:23 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-05-18 23:10:23 +0200 |
commit | e69a11012fb7543d47230663a01af2a7ec20960c (patch) | |
tree | 2c4a5b6759f76059736bdf5b30ea17f2a6ee8570 /src/Statistics.h | |
parent | Updated SandVillage prefabs to latest Gallery content. (diff) | |
parent | There's no "round" function in MSVC2008. (diff) | |
download | cuberite-e69a11012fb7543d47230663a01af2a7ec20960c.tar cuberite-e69a11012fb7543d47230663a01af2a7ec20960c.tar.gz cuberite-e69a11012fb7543d47230663a01af2a7ec20960c.tar.bz2 cuberite-e69a11012fb7543d47230663a01af2a7ec20960c.tar.lz cuberite-e69a11012fb7543d47230663a01af2a7ec20960c.tar.xz cuberite-e69a11012fb7543d47230663a01af2a7ec20960c.tar.zst cuberite-e69a11012fb7543d47230663a01af2a7ec20960c.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Statistics.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/Statistics.h b/src/Statistics.h index 540df38cc..f37f32e1e 100644 --- a/src/Statistics.h +++ b/src/Statistics.h @@ -9,6 +9,7 @@ +// tolua_begin enum eStatistic { // The order must match the order of cStatInfo::ms_Info @@ -77,6 +78,7 @@ enum eStatistic statCount }; +// tolua_end @@ -114,3 +116,49 @@ private: + +/* Signed (?) integral value. */ +typedef int StatValue; // tolua_export + + + + +/** Class that manages the statistics and achievements of a single player. */ +// tolua_begin +class cStatManager +{ +public: + // tolua_end + + cStatManager(); + + // tolua_begin + + /** Return the value of the specified stat. */ + StatValue GetValue(const eStatistic a_Stat) const; + + /** Set the value of the specified stat. */ + void SetValue(const eStatistic a_Stat, const StatValue a_Value); + + /** Reset everything. */ + void Reset(); + + /** Increment the specified stat. + * + * Returns the new value. + */ + StatValue AddValue(const eStatistic a_Stat, const StatValue a_Delta = 1); + + // tolua_end + +private: + + StatValue m_MainStats[statCount]; + + // TODO 10-05-2014 xdot: Use, mine, craft statistics + + +}; // tolua_export + + + |