map.h

来自「奇迹世界 部分源代码奇迹世界 部分源代码奇迹世界 部分源代码」· C头文件 代码 · 共 62 行

H
62
字号

#ifndef __MAP_H__
#define __MAP_H__

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "MapDefine.h"
#include <SolarHashTable.h>

class Field;
class MapInfo;
class Sector;
class GameZone;
class SectorGroup;

typedef util::SolarHashTable<Field *>				FIELD_HASH;
typedef util::SolarHashTable<Field *>::iterator		FIELD_HASH_ITR;

class Map
{
	enum { _MAX_FIELD_IN_MAP_NUM = 10, };
public:
	Map();
	~Map();	
	VOID				Init(		MapInfo * pMapInfo, int iFieldIndex, 
									CMemoryPoolFactory<Field> * pFieldPool, 
									CMemoryPoolFactory<SectorGroup> * pSectorGroupPool, 
									CMemoryPoolFactory<Sector> * pSectorPool );

	VOID				Release(	CMemoryPoolFactory<Field> * pFieldPool, 
									CMemoryPoolFactory<SectorGroup> * pSectorGroupPool,
									CMemoryPoolFactory<Sector> * pSectorPool );

	VOID				Update( DWORD dwDeltaTick );

	CODETYPE			GetMapCode();
	MapInfo *			GetMapInfo();
	BOOL				CheckMapVersion(CODETYPE dwCodeType, DWORD dwCheckSum);

	eZONETYPE			GetZoneType();
	inline VOID			SetGameZone( GameZone * pZone )		{ m_pGameZone = pZone;	}
	inline GameZone *	GetGameZone()						{ return m_pGameZone;	}
	
	inline Field *		GetFieldx( CODETYPE FieldCode )		{ return m_FieldHashTable.GetData( FieldCode );	}
	inline FIELD_HASH *	GetFieldHashTable()					{ return & m_FieldHashTable;	}

	DWORD				GetTotalMonsterNum();

protected:
	VOID				addField( Field * pField );

private:
	GameZone *			m_pGameZone;
	Zone *				m_pZone;
	MapInfo *			m_pMapInfo;
	FIELD_HASH			m_FieldHashTable;
};


#endif //__MAP_H__

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?