38 virtual void Tick(std::chrono::milliseconds a_Dt,
cChunk & a_Chunk)
override;
51 int GetAge(
void)
const {
return std::chrono::duration_cast<cTickTime>(
m_Timer).count(); }
#define CLASS_PROTODEF(classname)
std::chrono::duration< signed int, std::ratio_multiply< std::chrono::milliseconds::period, std::ratio< 50 > >> cTickTime
Vector3< float > Vector3f
cEntity(eEntityType a_EntityType, Vector3d a_Pos, float a_Width, float a_Height)
std::chrono::milliseconds m_Lifetime
bool CollectedBy(cEntity &a_Dest)
virtual bool DoesPreventBlockPlacement(void) const override
Returns whether blocks can be placed intersecting this entities' hitbox.
int GetLifetime(void) const
Returns the number of ticks that this pickup should live for.
bool IsCollected(void) const
Returns true if the pickup has already been collected.
cPickup(Vector3d a_Pos, const cItem &a_Item, bool IsPlayerCreated, Vector3f a_Speed=Vector3f(), int a_LifetimeTicks=6000, bool a_CanCombine=true)
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
void SetCanCombine(bool a_CanCombine)
Sets whether this pickup is allowed to combine with other similar pickups.
void SetAge(int a_Age)
Set the number of ticks that this entity has existed.
std::chrono::milliseconds m_Timer
The number of ticks that the entity has existed / timer between collect and destroy; in msec.
virtual void SpawnOn(cClientHandle &a_ClientHandle) override
Descendants override this function to send a command to the specified client to spawn the entity on t...
void SetLifetime(int a_Lifetime)
Set the number of ticks that this pickup should live for.
virtual bool DoTakeDamage(TakeDamageInfo &a_TDI) override
Makes this entity take damage specified in the a_TDI.
int GetAge(void) const
Returns the number of ticks that this entity has existed.
bool CanCombine(void) const
Returns whether this pickup is allowed to combine with other similar pickups.
const cItem & GetItem(void) const
bool IsPlayerCreated(void) const
Returns true if created by player (i.e.