diff options
author | Lane Kolbly <lane@rscheme.org> | 2017-07-12 12:13:27 +0200 |
---|---|---|
committer | Lukas Pioch <lukas@zgow.de> | 2017-07-12 12:13:27 +0200 |
commit | 793acd267f4a5801e2aa9e9dca7cf51c5a595a02 (patch) | |
tree | 0e2740c09bfbbff7fb297f990ecca1b0090ddcc3 /src/Entities/Pickup.h | |
parent | If entity is a player, send relmove packets. (diff) | |
download | cuberite-793acd267f4a5801e2aa9e9dca7cf51c5a595a02.tar cuberite-793acd267f4a5801e2aa9e9dca7cf51c5a595a02.tar.gz cuberite-793acd267f4a5801e2aa9e9dca7cf51c5a595a02.tar.bz2 cuberite-793acd267f4a5801e2aa9e9dca7cf51c5a595a02.tar.lz cuberite-793acd267f4a5801e2aa9e9dca7cf51c5a595a02.tar.xz cuberite-793acd267f4a5801e2aa9e9dca7cf51c5a595a02.tar.zst cuberite-793acd267f4a5801e2aa9e9dca7cf51c5a595a02.zip |
Diffstat (limited to 'src/Entities/Pickup.h')
-rw-r--r-- | src/Entities/Pickup.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/Entities/Pickup.h b/src/Entities/Pickup.h index ed5949f37..c2fcbd7f2 100644 --- a/src/Entities/Pickup.h +++ b/src/Entities/Pickup.h @@ -25,7 +25,7 @@ public: CLASS_PROTODEF(cPickup) - cPickup(double a_PosX, double a_PosY, double a_PosZ, const cItem & a_Item, bool IsPlayerCreated, float a_SpeedX = 0.f, float a_SpeedY = 0.f, float a_SpeedZ = 0.f); + cPickup(double a_PosX, double a_PosY, double a_PosZ, const cItem & a_Item, bool IsPlayerCreated, float a_SpeedX = 0.f, float a_SpeedY = 0.f, float a_SpeedZ = 0.f, int a_LifetimeTicks = 6000, bool a_CanCombine = true); cItem & GetItem(void) {return m_Item; } // tolua_export const cItem & GetItem(void) const {return m_Item; } @@ -36,12 +36,24 @@ public: virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override; + /** Returns whether this pickup is allowed to combine with other similar pickups */ + bool CanCombine(void) const { return m_bCanCombine; } // tolua_export + + /** Sets whether this pickup is allowed to combine with other similar pickups */ + void SetCanCombine(bool a_CanCombine) { m_bCanCombine = a_CanCombine; } // tolua_export + /** Returns the number of ticks that this entity has existed */ int GetAge(void) const { return std::chrono::duration_cast<cTickTime>(m_Timer).count(); } // tolua_export /** Set the number of ticks that this entity has existed */ void SetAge(int a_Age) { m_Timer = cTickTime(a_Age); } // tolua_export + /** Returns the number of ticks that this pickup should live for */ + int GetLifetime(void) const { return std::chrono::duration_cast<cTickTime>(m_Lifetime).count(); } // tolua_export + + /** Set the number of ticks that this pickup should live for */ + void SetLifetime(int a_Lifetime) { m_Lifetime = cTickTime(a_Lifetime); } // tolua_export + /** Returns true if the pickup has already been collected */ bool IsCollected(void) const { return m_bCollected; } // tolua_export @@ -58,4 +70,8 @@ private: bool m_bCollected; bool m_bIsPlayerCreated; + + bool m_bCanCombine; + + std::chrono::milliseconds m_Lifetime; }; // tolua_export |