📄 zonefactory.cpp
字号:
#include "StdAfx.h"
#include ".\zonefactory.h"
#include "Village.h"
#include "BattleZone.h"
#include <assert.h>
ZoneFactory::ZoneFactory(void)
{
m_pZonePool = NULL;
}
ZoneFactory::~ZoneFactory(void)
{
assert( m_pZonePool == NULL );
}
VOID ZoneFactory::Init()
{
m_pZonePool = new CMemoryPoolFactory<Zone>;
m_pZonePool->Initialize( 1500, 100 );
}
VOID ZoneFactory::Release()
{
SAFE_DELETE( m_pZonePool );
}
Zone* ZoneFactory::AllocZone()
{
Zone *pZone = m_pZonePool->Alloc();
pZone->Init();
return pZone;
}
VOID ZoneFactory::FreeZone( Zone *pZone )
{
pZone->Release();
m_pZonePool->Free( pZone );
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -