#ifndef _BREAKOUTGAMESCENE_H_
#define _BREAKOUTGAMESCENE_H_

#include "IScene.h"

#include "BreakoutBall.h"
#include "BreakoutBox.h"
#include "BreakoutWorldBoundaries.h"
#include "BreakoutPaddle.h"
#include "IBreakoutLevelGenerator.h"
#include "BreakoutLocationArray.h"
#include "BreakoutScoreCounter.h"
#include "Visualisation.h"
#include <vector>

class BreakoutGameScene : public IScene
{
	public:
	BreakoutGameScene();
	~BreakoutGameScene();

	virtual void Initialise();
	virtual void Draw();
	virtual void Update();
	virtual void Shutdown();

	virtual void Activate();
	virtual void Deactivate();

	virtual bool HandleEvent(IEvent* pEvent);

	void CheckGameConditions();
	void StartNewLevel();
	void Reset();

	protected:
	enum eLevelStatus
	{
		eLevelStarting = 0,
		eLevelPlaying,
		eLevelEnding
	};

	bool m_bIsActive;

	BreakoutBall* m_pBall;
	BreakoutPaddle* m_pPaddle;
	BreakoutWorldBoundaries* m_pWorldBoundaries;

	SpriteID m_bgSprite, m_startLevelText, m_endLevelText, m_livesLabel;

	BreakoutLocationArray* m_pBoxLocations;
	std::vector<IBreakoutLevelGenerator*> m_levelGenerators;
	BreakoutLevel* m_pCurrentLevel;
	BreakoutScoreCounter* m_pScoreCounter, *m_pLevelCounter, *m_pLivesCounter;

	eLevelStatus m_levelStatus;
	unsigned int m_statusChangeTime;
	int m_deathLineY;

	int m_playerLives, m_playerScore, m_levelNumber;
};

#endif
