📄 ctilemap.h
字号:
/*
============================================================================
* Name : CTileMap.h
* Part of : 2DMario
* Description : Definition of CTileMap
* Copyright (c) 2007 Nokia Corporation
============================================================================
*/
#ifndef __CTILEMAP_H__
#define __CTILEMAP_H__
// INCLUDE FILES
#include <e32base.h>
#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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -