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

//-----------------------------------------------------
// Include Files
//-----------------------------------------------------
#include "GameEngine.h"
#include "Sound.h"
#include "Mario.h"
//-----------------------------------------------------
// Level Class									
//-----------------------------------------------------
class Level
{
private:
	Level();				// Constructor
	static Level* m_LevelPtr;

public:
	virtual ~Level();		// Destructor
	static Level* GetSingleton();

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

	void Paint(MATRIX3X2 matView);
	void PaintCastleHalf(MATRIX3X2 matView);
	void PaintPipeParts(MATRIX3X2 matView);
	void Tick(double deltaTime);

	void DrawDebug(MATRIX3X2 matView);

	int GetWidth();
	int GetHeight();

	RECT2 GetEnterancePipeAABB();
	RECT2 GetExitPipeAABB();

	void DrawHitRegion(MATRIX3X2 matView);
	HitRegion* GetHitRegion();

	RECT2 GetFlagPoleAABB();
	void FlagCanDrop();
	bool FlagIsDown();

	// statics
	static const int CRUSH_ALTITUDE = 500;
	static const int CHECK_POINT = 1130;


private: 
	//-------------------------------------------------
	// Datamembers								
	//-------------------------------------------------

	bool m_FlagCanDrop, m_IsFlagDown;

	DOUBLE2 m_PipeEnterancePos,
			m_PipeExit1Pos,
			m_PipeExit2Pos,
			m_FlagPolePos,
			m_FlagPos;

	Bitmap	*m_BmpLevelPtr,
			*m_BmpCastleHalf,
			*m_BmpFlagPtr;

	Bitmap	*m_BmpEnterancePipePtr,
			*m_BmpExit1PipePtr,
			*m_BmpExit2PipePtr;

	RECT2 m_EnteranceRect, m_ExitRect, m_FlagPoleRect;

	//Bitmap* m_BmpCloudsPtr;

	HitRegion* m_HitLevelPtr;

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


