diff options
Diffstat (limited to 'src/Entities/ProjectileEntity.h')
-rw-r--r-- | src/Entities/ProjectileEntity.h | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/Entities/ProjectileEntity.h b/src/Entities/ProjectileEntity.h index 1c8c00854..d86589490 100644 --- a/src/Entities/ProjectileEntity.h +++ b/src/Entities/ProjectileEntity.h @@ -17,8 +17,7 @@ // tolua_begin -class cProjectileEntity : - public cEntity +class cProjectileEntity : public cEntity { // tolua_end @@ -27,8 +26,7 @@ class cProjectileEntity : // tolua_begin -public: - + public: /** The kind of the projectile. */ enum eKind { @@ -42,14 +40,21 @@ public: pkSplashPotion, pkFirework, pkWitherSkull, - } ; + }; // tolua_end CLASS_PROTODEF(cProjectileEntity) cProjectileEntity(eKind a_Kind, cEntity * a_Creator, Vector3d a_Pos, float a_Width, float a_Height); - cProjectileEntity(eKind a_Kind, cEntity * a_Creator, Vector3d a_Pos, Vector3d a_Speed, float a_Width, float a_Height); + cProjectileEntity( + eKind a_Kind, + cEntity * a_Creator, + Vector3d a_Pos, + Vector3d a_Speed, + float a_Width, + float a_Height + ); /** Creates a new instance of the specified projectile entity. a_Item is the item from which the projectile originated (such as firework or arrow). */ @@ -67,7 +72,9 @@ public: static std::unique_ptr<cProjectileEntity> Create( eKind a_Kind, cEntity * a_Creator, - double a_PosX, double a_PosY, double a_PosZ, + double a_PosX, + double a_PosY, + double a_PosZ, const cItem * a_Item, const Vector3d * a_Speed = nullptr ) @@ -75,7 +82,8 @@ public: return Create(a_Kind, a_Creator, {a_PosX, a_PosY, a_PosZ}, a_Item, a_Speed); } - /** Called by the physics blocktracer when the entity hits a solid block, the hit position and the face hit (BLOCK_FACE_) is given */ + /** 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(Vector3d a_HitPos, eBlockFace a_HitFace); /** Called by the physics blocktracer when the entity hits another entity */ @@ -110,16 +118,13 @@ public: /** Sets the internal InGround flag. To be used by MCA loader only! */ void SetIsInGround(bool a_IsInGround) { m_IsInGround = a_IsInGround; } -protected: - + protected: /** A structure that stores the Entity ID and Playername of the projectile's creator Used to migitate invalid pointers caused by the creator being destroyed. */ struct CreatorData { CreatorData(UInt32 a_UniqueID, const AString & a_Name, const cEnchantments & a_Enchantments) : - m_UniqueID(a_UniqueID), - m_Name(a_Name), - m_Enchantments(a_Enchantments) + m_UniqueID(a_UniqueID), m_Name(a_Name), m_Enchantments(a_Enchantments) { } @@ -143,4 +148,4 @@ protected: virtual void HandlePhysics(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override; virtual void SpawnOn(cClientHandle & a_Client) final override; -} ; // tolua_export +}; // tolua_export |