#pragma once
//-----------------------------------------------------
// Name, first name: Hoet, Guntran
// Group: 1DAE3
//-----------------------------------------------------

//-----------------------------------------------------
// Include Files
//-----------------------------------------------------
#include "GameEngine.h"
#include "EnemyMaster.h"
#include "Level.h"
#include "Mario.h"
//-----------------------------------------------------
// Troopa Class									
//-----------------------------------------------------
class Troopa : public EnemyMaster
{
public:
	Troopa(int x, int y, Bitmap *bmpBitmapPtr);				// Constructor
	virtual ~Troopa();		// Destructor

	//-------------------------------------------------
	// Methods - Member functions							
	//-------------------------------------------------

	virtual void Tick(double deltaTime);
	virtual void Paint(MATRIX3X2 matView);
	virtual void DeleteHitRegion();
	virtual bool IsJumpedOn();
	virtual bool IsFiredOn();
	virtual DOUBLE2 GetPos();
	virtual void DrawDebug(MATRIX3X2 matView);
	virtual RECT2 GetAABBRect();
	virtual void Move(DOUBLE2 moveValue);
	virtual void LevelCollision();
	virtual void SetVelocityToZero(bool velocityX, bool velocityY);
	virtual int GetEnemyID();
	virtual bool Destory();
	virtual void SetDirection(bool dir);

	// statics
	static const int ID = ID_TROOPA;
	static const int WALKING_STEPS = 2;
	static const int TOTAL_STEPS = 4;
	static const int SPEED_SLIDING = SPEED*4;
	//static const int AGRO_RANGE = 


private: 
	//-------------------------------------------------
	// enums								
	//-------------------------------------------------

	enum class BehaviourState : int
	{
		WALKING,
		TURNED,
		SLIDING,
		FIRED
	};

	//-------------------------------------------------
	// Methods								
	//-------------------------------------------------

	//virtual void Create(DOUBLE2 position);

	//-------------------------------------------------
	// Datamembers								
	//-------------------------------------------------

	void WalkingTick(double deltaTime);
	void TurnedTick(double deltaTime);
	void SlidingTick(double deltaTime);
	void FiredTick(double deltaTime);

	void Movement(double deltaTime);

	void WalkingPaint(MATRIX3X2 matView);
	void TurnedPaint(MATRIX3X2 matView);
	void SlidingPaint(MATRIX3X2 matView);
	void FiredPaint(MATRIX3X2 matView);

	//-------------------------------------------------
	// Datamembers								
	//-------------------------------------------------

	bool m_IsGoingLeft, m_IsActive;
	int m_Width, m_Height, m_TickCount, m_AnimationStep;

	DOUBLE2 m_Position, m_Velocity, m_Center;

	Bitmap *m_BmpBitmapPtr;
	RECT2 m_Rect;

	BehaviourState m_BehaviourState;

	// -------------------------
	// Disabling default copy constructor and default 
	// assignment operator.
	// -------------------------
	Troopa(const Troopa& yRef);									
	Troopa& operator=(const Troopa& yRef);	
};


