diff options
author | Samuel Barney <samjbarney@gmail.com> | 2014-07-10 21:44:14 +0200 |
---|---|---|
committer | Samuel Barney <samjbarney@gmail.com> | 2014-07-10 21:44:14 +0200 |
commit | ff7efaaef697e7fd15751e37c65fb765be041c53 (patch) | |
tree | 8cc5e592699439c90b28ec3e634a47295d96594c | |
parent | APIDump: Documented cWorld:SetChunkAlwaysTicked. (diff) | |
parent | Added cMobModel. (diff) | |
download | cuberite-ff7efaaef697e7fd15751e37c65fb765be041c53.tar cuberite-ff7efaaef697e7fd15751e37c65fb765be041c53.tar.gz cuberite-ff7efaaef697e7fd15751e37c65fb765be041c53.tar.bz2 cuberite-ff7efaaef697e7fd15751e37c65fb765be041c53.tar.lz cuberite-ff7efaaef697e7fd15751e37c65fb765be041c53.tar.xz cuberite-ff7efaaef697e7fd15751e37c65fb765be041c53.tar.zst cuberite-ff7efaaef697e7fd15751e37c65fb765be041c53.zip |
-rw-r--r-- | src/Entities/Compoments/AIComponent.h | 14 | ||||
-rw-r--r-- | src/Entities/Compoments/AttackComponent.h | 14 | ||||
-rw-r--r-- | src/Entities/Compoments/EnvironmentComponent.h | 20 | ||||
-rw-r--r-- | src/Entities/Compoments/InteractionComponent.h | 20 | ||||
-rw-r--r-- | src/Entities/Compoments/MobModel.h | 6 | ||||
-rw-r--r-- | src/Entities/Compoments/ModelComponent.h | 18 | ||||
-rw-r--r-- | src/Entities/Compoments/MovementComponent.h | 12 |
7 files changed, 104 insertions, 0 deletions
diff --git a/src/Entities/Compoments/AIComponent.h b/src/Entities/Compoments/AIComponent.h new file mode 100644 index 000000000..1659e2304 --- /dev/null +++ b/src/Entities/Compoments/AIComponent.h @@ -0,0 +1,14 @@ +#pragma once + +#include "../Entity.h" + +class cAIComponent +{ +protected: + cEntity * m_Self; +public: + cAIComponent(cEntity * a_Entity) : m_Self(a_Entity){} + + virtual void Tick(float a_Dt, cChunk & a_Chunk){} + +}; diff --git a/src/Entities/Compoments/AttackComponent.h b/src/Entities/Compoments/AttackComponent.h new file mode 100644 index 000000000..080f764b6 --- /dev/null +++ b/src/Entities/Compoments/AttackComponent.h @@ -0,0 +1,14 @@ +#pragma once + +#include "../Entity.h" + +class cAttackComponent +{ +protected: + cEntity * m_Self; +public: + cAttackComponent(cEntity * a_Entity) : m_Self(a_Entity){} + + virtual void OnAttackEntity(cEntity * a_Entity){} + +}; diff --git a/src/Entities/Compoments/EnvironmentComponent.h b/src/Entities/Compoments/EnvironmentComponent.h new file mode 100644 index 000000000..b080520f2 --- /dev/null +++ b/src/Entities/Compoments/EnvironmentComponent.h @@ -0,0 +1,20 @@ +#pragma once + +#include "../Entity.h" + +class cEnvironmentComponent +{ +protected: + cEntity * m_Self; +public: + cEnvironmentComponent(cEntity * a_Entity) : m_Self(a_Entity){} + + virtual void Tick(float a_Dt, cChunk & a_Chunk){} + + virtual void OnCollisionWithBlock(Vector3i & a_Position, BLOCKTYPE a_Block){} + virtual void OnStartedBurning(){} + virtual void OnFinishedBurning(){} + virtual void OnStartedDrowning(){} + virtual void OnFinishedDrowning(){} + +}; diff --git a/src/Entities/Compoments/InteractionComponent.h b/src/Entities/Compoments/InteractionComponent.h new file mode 100644 index 000000000..b8b99de79 --- /dev/null +++ b/src/Entities/Compoments/InteractionComponent.h @@ -0,0 +1,20 @@ +#pragma once + +#include "../Entity.h" + +class cInteractionComponent +{ +protected: + cEntity * m_Self; +public: + cInteractionComponent(cEntity * a_Entity) : m_Self(a_Entity){} + + virtual void OnCollisionWithEntity(cEntity * a_Entity){} + + virtual void OnTakeDamage(TakeDamageInfo & a_TDI){} + virtual void OnRightClicked(){} + virtual void OnKilled(cEntity * a_Killer = NULL){} + // virtual void OnPickup(){} + // virtual void OnDestroy(){} + +}; diff --git a/src/Entities/Compoments/MobModel.h b/src/Entities/Compoments/MobModel.h new file mode 100644 index 000000000..576c46c31 --- /dev/null +++ b/src/Entities/Compoments/MobModel.h @@ -0,0 +1,6 @@ +#include "ModelComponent.h" + +class cMobModel : public cModelComponent { + int m_MobType; + cMobModel(cEntity * a_Entity, int a_MobType): cModelComponent(a_Entity), m_MobType(a_MobType){} +}
\ No newline at end of file diff --git a/src/Entities/Compoments/ModelComponent.h b/src/Entities/Compoments/ModelComponent.h new file mode 100644 index 000000000..bbc4bcc21 --- /dev/null +++ b/src/Entities/Compoments/ModelComponent.h @@ -0,0 +1,18 @@ +#pragma once + +#include "../Entity.h" + +class cModelComponent +{ +protected: + cEntity * m_Self; +public: + cModelComponent(cEntity * a_Entity) : m_Self(a_Entity){} + virtual void SpawnOn(cClientHandle & a_Client){} + virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL){} + + virtual void HandlePhysics(float a_Dt, cChunk & a_Chunk){} + virtual void OnCollisionWithEntity(cEntity * a_Entity){} + + +}; diff --git a/src/Entities/Compoments/MovementComponent.h b/src/Entities/Compoments/MovementComponent.h new file mode 100644 index 000000000..a9896c3b0 --- /dev/null +++ b/src/Entities/Compoments/MovementComponent.h @@ -0,0 +1,12 @@ +#pragma once + +#include "../Entity.h" + +class cMovementComponent +{ +protected: + cEntity * m_Self; +public: + cMovementComponent(cEntity * a_Entity) : m_Self(a_Entity){} + +}; |