diff options
author | andrew <xdotftw@gmail.com> | 2014-04-07 15:31:15 +0200 |
---|---|---|
committer | andrew <xdotftw@gmail.com> | 2014-04-07 15:31:15 +0200 |
commit | c79ba3494c1db2919c08fd17ae54399b7d8b4915 (patch) | |
tree | 37b52b3be995e6b6f3d1aa05b1944d3fcd661e00 /src/Statistics.h | |
parent | Fix some of the comments in the PR tycho just did. (diff) | |
download | cuberite-c79ba3494c1db2919c08fd17ae54399b7d8b4915.tar cuberite-c79ba3494c1db2919c08fd17ae54399b7d8b4915.tar.gz cuberite-c79ba3494c1db2919c08fd17ae54399b7d8b4915.tar.bz2 cuberite-c79ba3494c1db2919c08fd17ae54399b7d8b4915.tar.lz cuberite-c79ba3494c1db2919c08fd17ae54399b7d8b4915.tar.xz cuberite-c79ba3494c1db2919c08fd17ae54399b7d8b4915.tar.zst cuberite-c79ba3494c1db2919c08fd17ae54399b7d8b4915.zip |
Diffstat (limited to 'src/Statistics.h')
-rw-r--r-- | src/Statistics.h | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/src/Statistics.h b/src/Statistics.h new file mode 100644 index 000000000..c6e1cf910 --- /dev/null +++ b/src/Statistics.h @@ -0,0 +1,116 @@ + +// Statistics.h + + + + +#pragma once + + + + +enum eStatistic +{ + // Do NOT change the order + + statInvalid = -1, + + /* Achievements */ + achOpenInv, /* Taking Inventory */ + achMineWood, /* Getting Wood */ + achCraftWorkbench, /* Benchmarking */ + achCraftPickaxe, /* Time to Mine! */ + achCraftFurnace, /* Hot Topic */ + achAcquireIron, /* Acquire Hardware */ + achCraftHoe, /* Time to Farm! */ + achMakeBread, /* Bake Bread */ + achBakeCake, /* The Lie */ + achCraftBetterPick, /* Getting an Upgrade */ + achCookFish, /* Delicious Fish */ + achOnARail, /* On A Rail */ + achCraftSword, /* Time to Strike! */ + achKillMonster, /* Monster Hunter */ + achKillCow, /* Cow Tipper */ + achFlyPig, /* When Pigs Fly */ + achSnipeSkeleton, /* Sniper Duel */ + achDiamonds, /* DIAMONDS! */ + achEnterPortal, /* We Need to Go Deeper */ + achReturnToSender, /* Return to Sender */ + achBlazeRod, /* Into Fire */ + achBrewPotion, /* Local Brewery */ + achEnterTheEnd, /* The End? */ + achDefeatDragon, /* The End. */ + achCraftEnchantTable, /* Enchanter */ + achOverkill, /* Overkill */ + achBookshelf, /* Librarian */ + achExploreAllBiomes, /* Adventuring Time */ + achSpawnWither, /* The Beginning? */ + achKillWither, /* The Beginning. */ + achFullBeacon, /* Beaconator */ + achBreedCow, /* Repopulation */ + achThrowDiamonds, /* Diamonds to you! */ + + /* Statistics */ + statGamesQuit, + statMinutesPlayed, + statDistWalked, + statDistSwum, + statDistFallen, + statDistClimbed, + statDistFlown, + statDistDove, + statDistMinecart, + statDistBoat, + statDistPig, + statDistHorse, + statJumps, + statItemsDropped, + statDamageDealt, + statDamageTaken, + statDeaths, + statMobKills, + statAnimalsBred, + statPlayerKills, + statFishCaught, + statJunkFished, + statTreasureFished, + + statCount +}; + + + + + + +/** Class used to store and query statistic-related information. */ +class cStatInfo +{ +public: + + cStatInfo(); + + cStatInfo(const eStatistic a_Type, const AString & a_Name, const eStatistic a_Depends = statInvalid); + + /** Type -> Name */ + static const AString & GetName(const eStatistic a_Type); + + /** Name -> Type */ + static eStatistic GetType(const AString & a_Name); + + /** Returns stat prerequisite. (Used for achievements) */ + static eStatistic GetPrerequisite(const eStatistic a_Type); + +private: + + eStatistic m_Type; + + AString m_Name; + + eStatistic m_Depends; + + static cStatInfo ms_Info[statCount]; +}; + + + |