summaryrefslogtreecommitdiffstats
path: root/src/Entities/Compoments/AIAgressiveComponent.h
blob: 2cd3f2304fb9140f81ef93b664da7945324c27c3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once
#include "AIComponent.h"

class cAIAgressiveComponent : public cAIComponent {
protected:
	enum MState{ATTACKING, IDLE, CHASING, ESCAPING} m_EMState;
	cEntity * m_Target;
public:
	cAIAgressiveComponent(cMonster * a_Monster) : cAIComponent(a_Monster), m_Target(null){}

	virtual void Tick(float a_Dt, cChunk & a_Chunk) override;
	virtual void InStateChasing(float a_Dt);
	
	virtual void EventSeePlayer(cEntity *);
	virtual void Attack(float a_Dt);

protected:
	virtual void EventLosePlayer(void);
	virtual void CheckEventLostPlayer(void);
	
	bool IsMovingToTargetPosition();
}