⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gamezonecommon.h

📁 奇迹世界 部分源代码奇迹世界 部分源代码奇迹世界 部分源代码
💻 H
字号:

#pragma once

//--------------------------------------------------------------------------------
//s 粮狼 皋葛府 钱 包访 内靛
//--------------------------------------------------------------------------------
#include <MemoryPoolFactory.h>

template<class _Ct>
class GAMEZONEPOOL
{
public:
	enum { _MAX_ZONE_POOL_SIZE=1000, };
	GAMEZONEPOOL(){ m_Pool.Initialize( _MAX_ZONE_POOL_SIZE );	}
	~GAMEZONEPOOL(){ m_Pool.Release();	}
	_Ct * Alloc() { return m_Pool.Alloc(); }
	VOID Free( _Ct * p ) { return m_Pool.Free(p); }
public:
	util::CMemoryPoolFactory<_Ct> m_Pool;
};


#define __DECL_GAMEZONEPOOL(_ClassType)									\
	private:															\
	static GAMEZONEPOOL<_ClassType> s_Pool;								\
	public:																\
	static _ClassType *	Create() { return s_Pool.Alloc(); }				\
	static VOID Destroy( _ClassType * pClass ) { s_Pool.Free( pClass ); }\
	static VOID	DisplayerPoolInfo()										\
	{																	\
		DISPMSG( "[%4u,%4u][band:%u node:%u]", s_Pool.m_Pool.GetPoolBasicSize(), s_Pool.m_Pool.GetPoolExtendSize(),	\
		s_Pool.m_Pool.GetNumberOfBands(), s_Pool.m_Pool.GetAvailableNumberOfTypes() );	\
	}

#define __IMPL_GAMEZONEPOOL(_ClassType)									\
	GAMEZONEPOOL<_ClassType> _ClassType::s_Pool;
//--------------------------------------------------------------------------------
//e 粮狼 皋葛府 钱 包访 内靛
//--------------------------------------------------------------------------------

⌨️ 快捷键说明

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