From c7c3724a3ee0e7a77fe9924ad25c36b6ec8fdd14 Mon Sep 17 00:00:00 2001 From: andrew Date: Sun, 11 May 2014 14:57:06 +0300 Subject: Statistic Manager --- src/Statistics.h | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'src/Statistics.h') 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 + + + -- cgit v1.2.3 From 993fd14ddfc881cf5be951df77da0338124d68cc Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 17 Jul 2014 16:33:09 +0200 Subject: Fixed basic whitespace problems. Indenting by spaces and alignment by spaces, as well as trailing whitespace on non-empty lines. --- src/Statistics.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/Statistics.h') diff --git a/src/Statistics.h b/src/Statistics.h index f37f32e1e..49750e8c0 100644 --- a/src/Statistics.h +++ b/src/Statistics.h @@ -62,7 +62,7 @@ enum eStatistic statDistDove, statDistMinecart, statDistBoat, - statDistPig, + statDistPig, statDistHorse, statJumps, statItemsDropped, @@ -143,10 +143,9 @@ public: /** Reset everything. */ void Reset(); - /** Increment the specified stat. - * - * Returns the new value. - */ + /** Increments the specified stat. + Returns the new value. + */ StatValue AddValue(const eStatistic a_Stat, const StatValue a_Delta = 1); // tolua_end -- cgit v1.2.3 From 7fff12bfacbb4bef1c02cea0ec10fdc9a6fb64e4 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 17 Jul 2014 19:13:23 +0200 Subject: Fixed spaces around single-line comments. There should be at least two spaces in front and one space after //-style comments. --- src/Statistics.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Statistics.h') diff --git a/src/Statistics.h b/src/Statistics.h index 49750e8c0..d70a2aeab 100644 --- a/src/Statistics.h +++ b/src/Statistics.h @@ -118,7 +118,7 @@ private: /* Signed (?) integral value. */ -typedef int StatValue; // tolua_export +typedef int StatValue; // tolua_export @@ -157,7 +157,7 @@ private: // TODO 10-05-2014 xdot: Use, mine, craft statistics -}; // tolua_export +}; // tolua_export -- cgit v1.2.3