1
0
cuberite-2a/source/Pawn.h
madmaxoft@gmail.com 4cebaa99f8 Refactored the world time.
Now it is stored in two values - WorldAge (only incremented, plugins cannot change) and TimeOfDay (plugins can change). Since sub-tick precision is needed in Tick(), we store it both as number of seconds (double) and number of ticks (Int64) is calculated off of that.

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1022 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-11-01 21:38:20 +00:00

67 lines
1.4 KiB
C++

#pragma once
#include "Entity.h"
struct TakeDamageInfo //tolua_export
{ //tolua_export
int Damage; //tolua_export
cEntity* Instigator; //tolua_export
}; //tolua_export
class cPawn : public cEntity //tolua_export
{ //tolua_export
public:
CLASS_PROTOTYPE()
cPawn();
virtual ~cPawn();
virtual void TeleportToEntity( cEntity* a_Entity ); //tolua_export
virtual void TeleportTo( const double & a_PosX, const double & a_PosY, const double & a_PosZ ); //tolua_export
virtual void Tick(float a_Dt) override;
void Heal( int a_Health ); //tolua_export
virtual void TakeDamage( int a_Damage, cEntity* a_Instigator ); //tolua_export
virtual void KilledBy( cEntity* a_Killer ); //tolua_export
int GetHealth() { return m_Health; } //tolua_export
enum MetaData {NORMAL, BURNING, CROUCHED, RIDING, SPRINTING, EATING, BLOCKING};
virtual void SetMetaData(MetaData a_MetaData);
virtual MetaData GetMetaData(void) const { return m_MetaData; }
virtual void InStateBurning(float a_Dt);
virtual void CheckMetaDataBurn();
virtual void SetMaxHealth(short a_MaxHealth);
virtual short GetMaxHealth() { return m_MaxHealth; }
protected:
short m_Health;
short m_MaxHealth;
bool m_bBurnable;
MetaData m_MetaData;
double m_LastPosX, m_LastPosY, m_LastPosZ;
Int64 m_TimeLastTeleportPacket; // In ticks
}; //tolua_export