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

//-----------------------------------------------------
// Include Files
//-----------------------------------------------------
#include "GameEngine.h"
#include "Level.h"
#include "EnemyList.h"
#include "Handy.h"
#include "BlockList.h"
//#include "HUD.h"
#include "Sound.h"
//-----------------------------------------------------
// Fireball Class									
//-----------------------------------------------------
class HUD;

class Fireball
{
public:
	Fireball(DOUBLE2 position, Bitmap* bmpFireballPtr, Bitmap* bmpExplosionPtr);				// Constructor
	virtual ~Fireball();		// Destructor

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

	//bool Create(DOUBLE2 position);
	void Tick(double deltaTime);
	void Paint(MATRIX3X2 matView);
	void TimedDestroy();
	bool CanDestroy();

	//bool HitEnemy();
	//int GetScoreShotEnemy();

	DOUBLE2 GetPosition();
	RECT2 GetAABB();

	//satic const int's
	static const int INTERVAL = 6;
	static const int FIREBALL_STEPS = 4;
	static const int EXPLOSION_STEPS = 3;

private: 
	// enum

	enum class Stage : int
	{
		FIREBALL,
		EXPLOSION,
		DESTROY
	};

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

	void DoFireballTick(double deltaTime);
	void VerticalLevelCollision(HitRegion* hitLevelPtr);
	void HorizontalLevelCollision(HitRegion* hitLevelPtr);
	void EnemyCollision();
	void BlockCollision();

	//-------------------------------------------------
	// Datamembers								
	//-------------------------------------------------
	bool m_EnemyIsHit, m_CanDestroy;

	int m_TickCount, m_AnimationStep, m_Direction;
	int m_ShotEnemyScore;

	double m_Speed;

	Bitmap *m_BmpFireballPtr,
		*m_BmpExplosionPtr;

	Stage m_Stage;

	RECT2 m_Rect;

	DOUBLE2 m_Position, m_Velocity, m_Gravity;

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


