diff options
author | Tycho <work.tycho+git@gmail.com> | 2014-05-24 13:44:49 +0200 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2014-05-24 13:44:49 +0200 |
commit | 4ab82881165cb180b020e67f851028718ab84d87 (patch) | |
tree | 93e773ebd46fb76dd520821133b01f6d99b26e94 /src/Entities/Player.h | |
parent | Ignore CTest files (diff) | |
parent | Merge pull request #1022 from mc-server/FixMineshafts (diff) | |
download | cuberite-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/Entities/Player.h')
-rw-r--r-- | src/Entities/Player.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/Entities/Player.h b/src/Entities/Player.h index 6fc7e2875..b7cb27d6c 100644 --- a/src/Entities/Player.h +++ b/src/Entities/Player.h @@ -7,6 +7,8 @@ #include "../World.h" #include "../ClientHandle.h" +#include "../Statistics.h" + @@ -125,6 +127,9 @@ public: inline const cItem & GetEquippedItem(void) const { return GetInventory().GetEquippedItem(); } // tolua_export + /** Returns whether the player is climbing (ladders, vines e.t.c). */ + bool IsClimbing(void) const; + virtual void TeleportToCoords(double a_PosX, double a_PosY, double a_PosZ) override; // tolua_begin @@ -174,6 +179,15 @@ public: cTeam * UpdateTeam(void); // tolua_end + + /** Return the associated statistic and achievement manager. */ + cStatManager & GetStatManager() { return m_Stats; } + + /** Awards the player an achievement. + If all prerequisites are met, this method will award the achievement and will broadcast a chat message. + If the achievement has been already awarded to the player, this method will just increment the stat counter. + Returns the _new_ stat value. (0 = Could not award achievement) */ + unsigned int AwardAchievement(const eStatistic a_Ach); void SetIP(const AString & a_IP); @@ -306,6 +320,8 @@ public: void AbortEating(void); virtual void KilledBy(cEntity * a_Killer) override; + + virtual void Killed(cEntity * a_Victim) override; void Respawn(void); // tolua_export @@ -375,6 +391,9 @@ public: /** If true the player can fly even when he's not in creative. */ void SetCanFly(bool a_CanFly); + /** Update movement-related statistics. */ + void UpdateMovementStats(const Vector3d & a_DeltaPos); + /** Returns wheter the player can fly or not. */ virtual bool CanFly(void) const { return m_CanFly; } // tolua_end @@ -487,6 +506,8 @@ protected: cTeam * m_Team; + cStatManager m_Stats; + void ResolvePermissions(void); @@ -506,6 +527,9 @@ protected: /** Called in each tick if the player is fishing to make sure the floater dissapears when the player doesn't have a fishing rod as equipped item. */ void HandleFloater(void); + /** Tosses a list of items. */ + void TossItems(const cItems & a_Items); + /** Adds food exhaustion based on the difference between Pos and LastPos, sprinting status and swimming (in water block) */ void ApplyFoodExhaustionFromMovement(); |