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

//-----------------------------------------------------
// Include Files
//-----------------------------------------------------
#include "GameEngine.h"
#include "CollisionList.h"
//-----------------------------------------------------
// HUD Class									
//-----------------------------------------------------
class SuperMarioBros;

class HUD
{
private:
	HUD();				// Constructor
	static HUD* m_HUDPtr;

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

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

	void Tick(double deltaTime);
	void Paint();
	void DrawDeltaTimeBar(bool show);
	void DrawScorePopUp(DOUBLE2 position, int popUpValue);

	void AddCoin();
	void AddScore(int addValue);
	int GetTime();

	static const int TIME_START = 400;
	static const int LETTER_WIDTH = 8;
	static const int LETTER_HEIGHT = 8;
	static const int NR_LETTERS_PER_ROW = 16;
	static const int SCORE_POPUP_DURATION = 60;

	static const int ANIMATION_INTERVAL = 10;
	static const int ANIMATION_STEPS = 6;
	static const int HUD_SCALE = 3;

private: 
	//-------------------------------------------------
	// Functions						
	//-------------------------------------------------

	void DrawBitmapString(String input, int x, int y);
	void DrawCoinIcon(int x, int y);
	String NumberWithLeadingZeros(int number, int max);


	//-------------------------------------------------
	// Datamembers								
	//-------------------------------------------------
	int m_Time, m_TickCount, m_Score, m_BitmapWidth, m_BitmapHeight, m_CoinCount, m_CoinAnimationStep,
		m_CoinWidth, m_CoinHeight, m_ScorePopUpTimer;
	int m_DeltaTimeMaxDelay;

	double m_DeltaTime, m_DeltaTimeMax;

	Bitmap *m_BmpFontPtr, *m_BmpCoinIconPtr;

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

 
