summaryrefslogtreecommitdiffstats
path: root/src/Entities/ProjectileEntity.h
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2016-01-12 11:13:36 +0100
committerLogicParrot <LogicParrot@users.noreply.github.com>2016-01-12 11:13:36 +0100
commite2a053263f4798f879392756bb056eabf0ade3a4 (patch)
tree5d543baa8842fe74c4ed66984860be483d28c627 /src/Entities/ProjectileEntity.h
parentMerge pull request #2853 from cuberite/DetailedBlockAreaLogging (diff)
parentTamed wolf assists owner (attack / defence) (diff)
downloadcuberite-e2a053263f4798f879392756bb056eabf0ade3a4.tar
cuberite-e2a053263f4798f879392756bb056eabf0ade3a4.tar.gz
cuberite-e2a053263f4798f879392756bb056eabf0ade3a4.tar.bz2
cuberite-e2a053263f4798f879392756bb056eabf0ade3a4.tar.lz
cuberite-e2a053263f4798f879392756bb056eabf0ade3a4.tar.xz
cuberite-e2a053263f4798f879392756bb056eabf0ade3a4.tar.zst
cuberite-e2a053263f4798f879392756bb056eabf0ade3a4.zip
Diffstat (limited to 'src/Entities/ProjectileEntity.h')
-rw-r--r--src/Entities/ProjectileEntity.h40
1 files changed, 18 insertions, 22 deletions
diff --git a/src/Entities/ProjectileEntity.h b/src/Entities/ProjectileEntity.h
index 7ee87f93a..b354c7cfc 100644
--- a/src/Entities/ProjectileEntity.h
+++ b/src/Entities/ProjectileEntity.h
@@ -21,7 +21,7 @@ class cProjectileEntity :
public cEntity
{
typedef cEntity super;
-
+
public:
/** The kind of the projectile. The numbers correspond to the network type ID used for spawning them in the protocol. */
enum eKind
@@ -38,26 +38,22 @@ public:
pkWitherSkull = 66,
pkFishingFloat = 90,
} ;
-
+
// tolua_end
-
+
CLASS_PROTODEF(cProjectileEntity)
cProjectileEntity(eKind a_Kind, cEntity * a_Creator, double a_X, double a_Y, double a_Z, double a_Width, double a_Height);
cProjectileEntity(eKind a_Kind, cEntity * a_Creator, const Vector3d & a_Pos, const Vector3d & a_Speed, double a_Width, double a_Height);
-
+
static cProjectileEntity * Create(eKind a_Kind, cEntity * a_Creator, double a_X, double a_Y, double a_Z, const cItem * a_Item, const Vector3d * a_Speed = nullptr);
-
+
/** Called by the physics blocktracer when the entity hits a solid block, the hit position and the face hit (BLOCK_FACE_) is given */
virtual void OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace);
-
+
/** Called by the physics blocktracer when the entity hits another entity */
- virtual void OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos)
- {
- UNUSED(a_EntityHit);
- UNUSED(a_HitPos);
- }
-
+ virtual void OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos);
+
/** Called by Chunk when the projectile is eligible for player collection */
virtual void CollectedBy(cPlayer & a_Dest);
@@ -65,7 +61,7 @@ public:
/** Returns the kind of the projectile (fast class identification) */
eKind GetProjectileKind(void) const { return m_ProjectileKind; }
-
+
/** Returns the unique ID of the entity who created this projectile
May return an ID <0
*/
@@ -75,18 +71,18 @@ public:
Will be empty for non-player creators
*/
AString GetCreatorName(void) const { return m_CreatorData.m_Name; }
-
+
/** Returns the string that is used as the entity type (class name) in MCA files */
AString GetMCAClassName(void) const;
-
+
/** Returns true if the projectile has hit the ground and is stuck there */
bool IsInGround(void) const { return m_IsInGround; }
-
+
// tolua_end
-
+
/** Sets the internal InGround flag. To be used by MCA loader only! */
void SetIsInGround(bool a_IsInGround) { m_IsInGround = a_IsInGround; }
-
+
protected:
/** A structure that stores the Entity ID and Playername of the projectile's creator
@@ -107,17 +103,17 @@ protected:
/** The type of projectile I am */
eKind m_ProjectileKind;
-
+
/** The structure for containing the entity ID and name who has created this projectile
The ID and / or name may be nullptr (e.g. for dispensers / mobs). */
CreatorData m_CreatorData;
-
+
/** True if the projectile has hit the ground and is stuck there */
bool m_IsInGround;
-
+
// cEntity overrides:
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
virtual void HandlePhysics(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
virtual void SpawnOn(cClientHandle & a_Client) override;
-
+
} ; // tolua_export