www.pudn.com > Example2D.rar > CTileMap.h


/////////////////////////////////////////////////////////////////////////////// 
// 
// CTileMap.h 
// 
// Copyright (c) 2003 Forum Nokia.  All rights reserved. 
// 
// 	 Technology developed by Rocket Science Oy Ltd 
// 
/////////////////////////////////////////////////////////////////////////////// 
 
#ifndef __CTILEMAP_H__ 
#define __CTILEMAP_H__ 
 
// INCLUDE FILES 
#include  
#include "CBitmap.h" 
 
// FORWARD DECLARATIONS 
class MSystem; 
 
// CLASS DECLARATION 
 
/** 
* CTilemap class holds the game level. 
*/ 
class CTileMap 
	: public CBase 
	{ 
	public: 
		 
		/** 
		* Two-phased constructor. 
		*/ 
		static CTileMap* NewL( CBitmap* aBitmap, TSize aSize, const TUint8* aMap, MSystem* aSystem ); 
 
		/** 
		* Destructor. 
		*/			 
		~CTileMap(); 
 
	private: 
		 
		/** 
		* Default constructor 
		*/	 
		CTileMap( CBitmap* aBitmap, TSize aSize, const TUint8* aMap, MSystem* aSystem ); 
 
		/** 
		* Second phase constructor 
		*/ 
		void ConstructL(); 
 
	public: 
 
		/** 
		* Draws the tilemap. 
		* @param aTarget Target bitmap where tilemap is drawn. 
		* @param aCamera Current camera position. 
		*/ 
		void Draw( CBitmap& aTarget, const TPoint& aCamera ); 
 
		/** 
		* Returns the tile from given position. 
		* @param aLayer From which layer the tile is checked. 
		* @return TInt Number of tile. 
		*/ 
		TInt Tile( const TPoint& aPixel, TInt aLayer ); 
 
	private: // Data members 
 
		CBitmap* iBitmap;			/// tile graphics 
		TSize iSize;				/// tilemap size 
		MSystem* iSystem;			/// pointer to system 
		const TUint8* iMap[ 3 ];	/// map layers 
 
	}; 
 
#endif 
 
// End of file