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

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

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

	virtual void Paint(MATRIX3X2 matView);
	virtual void Tick(double deltaTime);

	virtual DOUBLE2 GetPos();
	virtual void DrawDebug(MATRIX3X2 matView);
	virtual RECT2 GetAABBRect();

	virtual bool IsHit();
	virtual int ReturnReward();
	virtual void Delete();
	virtual void Move(DOUBLE2 dir);
	virtual void ZeroVelocity(bool xVelocity, bool yVelocity);
	virtual int GetType();
	// 0 = locked
	// 1 = popout
	// 2 = pickup
	// 3 = destroyed
	virtual void SetStage(int stage);
	virtual int GetMushroomType();


private: 
	//-------------------------------------------------
	// enum								
	//-------------------------------------------------
	enum class STAGE : int
	{
		LOCKED,
		POPOUT,
		PICKUP,
		DESTROYED
	};
	//-------------------------------------------------
	// own methods								
	//-------------------------------------------------

	void PopOutTick(double deltaTime);
	void PickUpTick(double deltaTime);

	void UpdateAABB();

	void LevelCollisionH();
	void LevelCollisionV();

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

	static const int FORCE_GRAVITY = 800;	//800
	static const int SPEED = 2000;	// 2000

	bool m_IsDestroyed, m_GoesRight;

	int m_Width, m_Height, m_EndHeight;

	DOUBLE2 m_Position, m_Velocity;

	RECT2 m_AABB;

	Bitmap *m_BmpBitmapPtr;
	HitRegion* m_HitLevelPtr;

	STAGE m_Stage;

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


