summaryrefslogtreecommitdiffstats
path: root/source/Entity.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-03-03 20:05:11 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-03-03 20:05:11 +0100
commit01b24d73eab6b0e708063d82f01ea9bb9296550c (patch)
tree6646ddda7a137b8960484b9fa2614683545e756a /source/Entity.h
parentSimulators are woken up upon chunk load (diff)
downloadcuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar
cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar.gz
cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar.bz2
cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar.lz
cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar.xz
cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar.zst
cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.zip
Diffstat (limited to 'source/Entity.h')
-rw-r--r--source/Entity.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/source/Entity.h b/source/Entity.h
index 82e1c3c7a..e0c0bb191 100644
--- a/source/Entity.h
+++ b/source/Entity.h
@@ -37,6 +37,7 @@
class cWorld;
class cReferenceManager;
class cClientHandle;
+class cPlayer;
class MTRand;
@@ -130,6 +131,8 @@ public:
void SetRotation(float a_Rotation);
void SetPitch (float a_Pitch);
void SetRoll (float a_Roll);
+
+ void AddSpeed(const Vector3d & a_AddSpeed);
// tolua_end
inline int GetUniqueID(void) const { return m_UniqueID; } // tolua_export
@@ -147,6 +150,12 @@ public:
*/
virtual void SpawnOn(cClientHandle & a_Client) {ASSERT(!"SpawnOn() unimplemented!"); }
+ /// Attaches to the specified entity; detaches from any previous one first
+ void AttachTo(cEntity * a_AttachTo);
+
+ /// Detaches from the currently attached entity, if any
+ void Detach(void);
+
void WrapRotation();
// tolua_begin
@@ -159,11 +168,14 @@ public:
virtual bool IsRclking (void) const {return false; }
// tolua_end
+
+ /// Called when the specified player right-clicks this entity
+ virtual void OnRightClicked(cPlayer & a_Player) {};
protected:
- virtual void Destroyed() {} // Called after the entity has been destroyed
+ virtual void Destroyed(void) {} // Called after the entity has been destroyed
- void SetWorld( cWorld* a_World ) { m_World = a_World; }
+ void SetWorld(cWorld * a_World) { m_World = a_World; }
void MoveToCorrectChunk(bool a_bIgnoreOldChunk = false);
friend class cReferenceManager;
@@ -175,6 +187,12 @@ protected:
static int m_EntityCount;
int m_UniqueID;
+
+ /// The entity to which this entity is attached (vehicle), NULL if none
+ cEntity * m_AttachedTo;
+
+ /// The entity which is attached to this entity (rider), NULL if none
+ cEntity * m_Attachee;
cReferenceManager* m_Referencers;
cReferenceManager* m_References;