49 virtual void Tick(std::chrono::milliseconds a_Dt,
cChunk & a_Chunk)
override;
85 void UpdatePaddles(
bool rightPaddleUsed,
bool leftPaddleUsed);
#define CLASS_PROTODEF(classname)
virtual void BroadcastMovementUpdate(const cClientHandle *a_Exclude=nullptr) override
Updates clients of changes in the entity.
int GetForwardDirection(void) const
cBoat(Vector3d a_Pos, eMaterial a_Material)
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...
static AString MaterialToString(const eMaterial a_Material)
Returns the eMaterial as string.
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
static eMaterial ItemToMaterial(const cItem &a_Item)
Returns the eMaterial that should be used for a boat created from the specified item.
virtual void HandlePhysics(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
Handles the physics of the entity - updates position based on speed, updates speed based on environme...
static eMaterial StringToMaterial(const AString &a_Material)
Returns the boat material for the passed string.
void UpdatePaddles(bool rightPaddleUsed, bool leftPaddleUsed)
int GetLastDamage(void) const
virtual bool DoTakeDamage(TakeDamageInfo &TDI) override
Makes this entity take damage specified in the a_TDI.
void SetLastDamage(int TimeSinceLastHit)
bool IsLeftPaddleUsed(void) const
void SetMaterial(cBoat::eMaterial a_Material)
Sets the eMaterial of the boat.
virtual void OnRightClicked(cPlayer &a_Player) override
Called when the specified player right-clicks this entity.
float GetDamageTaken(void) const
eMaterial GetMaterial(void) const
Returns the eMaterial of the boat.
bool IsRightPaddleUsed(void) const
virtual void HandleSpeedFromAttachee(float a_Forward, float a_Sideways) override
static cItem MaterialToItem(eMaterial a_Material)
Returns the boat item of the boat material.
cEntity(eEntityType a_EntityType, Vector3d a_Pos, float a_Width, float a_Height)