summaryrefslogtreecommitdiffstats
path: root/src/Statistics.h
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-05-24 13:44:49 +0200
committerTycho <work.tycho+git@gmail.com>2014-05-24 13:44:49 +0200
commit4ab82881165cb180b020e67f851028718ab84d87 (patch)
tree93e773ebd46fb76dd520821133b01f6d99b26e94 /src/Statistics.h
parentIgnore CTest files (diff)
parentMerge pull request #1022 from mc-server/FixMineshafts (diff)
downloadcuberite-4ab82881165cb180b020e67f851028718ab84d87.tar
cuberite-4ab82881165cb180b020e67f851028718ab84d87.tar.gz
cuberite-4ab82881165cb180b020e67f851028718ab84d87.tar.bz2
cuberite-4ab82881165cb180b020e67f851028718ab84d87.tar.lz
cuberite-4ab82881165cb180b020e67f851028718ab84d87.tar.xz
cuberite-4ab82881165cb180b020e67f851028718ab84d87.tar.zst
cuberite-4ab82881165cb180b020e67f851028718ab84d87.zip
Diffstat (limited to 'src/Statistics.h')
-rw-r--r--src/Statistics.h48
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
+
+
+