blob: 29fe8786fa9a7647798da940e24f0df327cdf9e1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#pragma once
#include "Entity.h"
class cComponent
{
protected:
cEntity * m_Self;
public:
cComponent(cEntity * a_Entity) : m_Self(a_Entity){}
// General
virtual void Tick(float a_Dt, cChunk & a_Chunk){}
virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL){}
virtual void SpawnOn(cClientHandle & a_Client){}
// World/Model Interaction
virtual void HandlePhysics(float a_Dt, cChunk & a_Chunk){}
virtual void OnCollisionWithEntity(cEntity * a_Entity){}
// Environmental Reactions
virtual void OnCollisionWithBlock(Vector3i & a_Position, BLOCKTYPE a_Block){}
virtual void OnStartedBurning(){}
virtual void OnFinishedBurning(){}
// Reactions
virtual void OnTakeDamage(TakeDamageInfo & a_TDI){}
virtual void OnRightClicked(){}
virtual void OnKilled(cEntity * a_Killer = NULL){}
// virtual void OnPickup(){}
// virtual void OnDestroy(){}
// Logic
virtual void OnAttackEntity(cEntity * a_Entity){}
};
|