?? map.h
字號:
#pragma once
#include "incs.h"
#include "factory.h"
#include "role.h"
const int CELL_SIZE = 40;
const int CELL_X = 15;
const int CELL_Y = 13;
const int CELL_X_ALL = 17;
const int CELL_Y_ALL = 15;
const int CELL_NUM = CELL_X_ALL * CELL_Y_ALL;
const int SCENE_LEFT = 20;
const int SCENE_TOP = 41;
enum ItemType
{
itNone,
itFirm,
itSolid,
itBox,
itPopo,
itGift
};
enum BlindageType
{
btNone,
btBlind,
btBush,
btTent
};
struct ExplosionData // 塊爆炸數(shù)據(jù)
{
BYTE Dr : 4; // 方向
BYTE IsHead : 4; // 是否為邊界
BYTE Gift : 4; // 是否有寶物
BYTE Timer : 4;
BYTE Status; // 狀態(tài)
BYTE Dead;
};
struct Cell
{
Cell(void) : pItem(NULL), pBlindage(NULL) {}
BYTE Ground;
BYTE Type;
BYTE Blind;
BYTE ID;
CItem* pItem;
CBlindage* pBlindage;
ExplosionData Explosion;
};
#define MAP CMap::Instance()
class CMap
{
private:
CMap();
~CMap();
public:
static CMap& Instance(void);
void Update(float fDelta);
void Draw(void) const;
void LoadMap(ASLFile *pFile);
//void LoadRole(ASLFile *pFile, int nID);
inline Cell* operator[](int i)
{ ASSERT(i >= 0 && i < CELL_NUM); return m_vCell + CELL_X_ALL * i; }
private:
void ReleaseMap(void);
void DrawGround(void) const;
void DrawExplosion(int nCellY, int nCellX) const;
private:
Cell m_vCell[CELL_NUM];
int m_vRoleSeq[ROLE_NUM];
ASLBitmap *m_pbmGround;
ASLBitmap *m_pbmExplosion;
};
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -