25 virtual void Tick(std::chrono::milliseconds a_Dt,
cChunk & a_Chunk)
override;
34 int GetAge(
void)
const {
return std::chrono::duration_cast<cTickTime>(
m_Timer).count(); }
48 static std::vector<int>
Split(
int a_Reward);
#define CLASS_PROTODEF(classname)
std::chrono::duration< signed int, std::ratio_multiply< std::chrono::milliseconds::period, std::ratio< 50 > >> cTickTime
cEntity(eEntityType a_EntityType, Vector3d a_Pos, float a_Width, float a_Height)
cExpOrb(Vector3d a_Pos, int a_Reward)
static std::vector< int > Split(int a_Reward)
Split reward into small values according to regular Minecraft rules.
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.
int GetReward(void) const
Get the exp amount.
int GetAge(void) const
Returns the number of ticks that this entity has existed.
void SetReward(int a_Reward)
Set the exp amount.
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
virtual void SpawnOn(cClientHandle &a_Client) override
Descendants override this function to send a command to the specified client to spawn the entity on t...
virtual bool DoTakeDamage(TakeDamageInfo &a_TDI) override
Makes this entity take damage specified in the a_TDI.