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

//-----------------------------------------------------
// Include Files
//-----------------------------------------------------
#include "GameEngine.h"
#include <vector>

#include "EntityMaster.h"
#include "Coin.h"
#include "CoinBlock.h"
#include "Flower.h"
#include "Mushroom.h"
#include "Mario.h"
#include "CollisionList.h"
#include "Star.h"

//-----------------------------------------------------
// EntityList Class									
//-----------------------------------------------------
class EntityList
{
private:
	EntityList();				// Constructor
	static EntityList* m_EntityListPtr;

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

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

	void Create();
	void Tick(double deltaTime);
	void Paint(MATRIX3X2 matView);
	void DeleteEntities();
	void DrawDebug(MATRIX3X2 matView);
	void DeleteThisEntity(int index);
	void ZeroVelocity(int index, bool xVelocity, bool yVelocity);
	//0=nothing
	//1=coin
	//2=flower
	//3=mushroom
	//4=star
	int GetType(int index);

	// 0 = locked
	// 1 = popout
	// 2 = pickup
	// 3 = destroyed
	void SetStage(int index, int stage);

	//0= normal
	//1 = 1 up
	int GetMushroomType(int index);

	//0=nothing
	//1=coin
	//2=flower
	//3=mushroom
	//4=star
	void AddNewEntity(DOUBLE2 pos, int type, int mushroomType = 0);
	int GetSize();
	void Move(int index, DOUBLE2 dir);

	int ReturnReward(int index);

	RECT2 GetAABBRect(int index);
	DOUBLE2 GetPosition(int index);

	static const int NR_OF_COINS = 19;
	static const int NR_OF_COINBLOCKS = 0;
	static const int NR_OF_FLOWERS = 0;
	static const int NR_OF_MUSHROOMS = 1;
	// total entities
	static const int NR_OF_ENTITIES = NR_OF_COINS + NR_OF_COINBLOCKS + NR_OF_FLOWERS + NR_OF_MUSHROOMS;

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

	Bitmap	*m_BmpCoinPtr,
			*m_BmpCoinBlockPtr,
			*m_BmpFlowerPtr,
			*m_BmpMushroomPtr,
			*m_BmpStarPtr;

	//EntityMaster *m_EntityPtrArr[NR_OF_ENTITIES];
	std::vector <EntityMaster*> m_EntityPtrArr;

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


