
//

//CMap.h


/*******************************************************
//
//	Name: CMap.h
//
//	Author: Dave Ratti
//
//	Date:6-06-01
//
//	Modified: 12-12-01
//
//	Notes: Standard square tile map
//
//
//
//
//
*********************************************************/

#ifndef CMAP_H_
#define CMAP_H_

#include "stringc.h"
#include "CGraphicSystem.h"
#include "Assert.h"

#include "CTile.h"
#include "CGameObject.h"
#include "CMap.h"


/////////////////////////////////////////////////////////
//mousemap directions
enum MouseMapDirection{
	MM_CENTER=0,
	MM_NW=1,
	MM_NE=2,
	MM_SW=3,
	MM_SE=4
};

enum Direction
{
	N=1,
	W=2,
	S=3,
	E=4
};

enum OVERLAY
{
	None=0,
	Green=1,
	Red=2
};

//mousemap structure
struct CMouseMap
{
	POINT ptSize;
	POINT ptRef;
	MouseMapDirection* mmdLookUp;
};




/////////////////////////////////////////////////////////

class CMap : public CGameObject
{

public:

	CMap(){ Clear(); }
	~CMap(){ }


	void Clear();
	void Init();
	void Init(STRINGC file);
	void Shutdown();
	

	void Draw();	
	void Scroll(POINT p);		//scrolls worldCords of map by p.x and p.y pixels.

	virtual void Collision(CGameObject* obj);

	//Helper functions
	static	Direction getOppositeDirection(Direction d);
	
	
	int Width;
	int Height;
	int TileWidth;
	int TileHeight;

	POINT getAnchor(){ return Anchor; }

protected:

	//we'll store out map in an Array
	
	CTile map[100][100];
	POINT Anchor;
	void setAnchor();
	void loadObjects(STRINGC mapName);
		
	
};


#endif

