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

//-----------------------------------------------------
// Include Files
//-----------------------------------------------------
#include "GameEngine.h"
#include "EnemyMaster.h"
#include "Level.h"
#include "Mario.h"
//-----------------------------------------------------
// Goomba Class									
//-----------------------------------------------------
class SuperMarioBros;

class Goomba : public EnemyMaster
{
public:
	Goomba(int x, int y, Bitmap *bmpBitmapPtr);				// Constructor
	virtual ~Goomba();		// 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 int GetEnemyID();
	virtual bool Destory();

	virtual void SetDirection(bool dir);	

	virtual void SetVelocityToZero(bool velocityX, bool velocityY);
	//static const int AGRO_RANGE = 100;
	static const int ID = ID_GOOMBA;
	static const int KILLED_JUMP = 150;
	static const int STOMPED_ANIMATION_TIME = 30;

private: 

	//-------------------------------------------------
	// Enums								
	//-------------------------------------------------

	enum class BehaviourState : int
	{
		WALKING,
		STOMPED,
		BURNED
	};

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

	void WalkingTick(double deltaTime);
	void StompedTick(double deltaTime);
	void BurnedTick(double deltaTime);

	void WalkingPaint(MATRIX3X2 matView);
	void StompedPaint(MATRIX3X2 matView);
	void BurnedPaint(MATRIX3X2 matView);

	void Movement(double deltaTime);

	//-------------------------------------------------
	// Datamembers								
	//-------------------------------------------------
	static const int WALKING_STEPS = 2;
	//static const int DYING_STEPS = 1;
	static const int TOTAL_STEPS = 3;

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

	DOUBLE2 m_Position, m_Velocity, m_Center;

	Bitmap *m_BmpBitmapPtr;
	RECT2 m_Rect;				// RECT2 to avoid warnings (double to int) in the DrawBitmap of Goomba

	BehaviourState m_BehaviourState;

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


