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

📄 sectorgroup.cpp

📁 奇迹世界 部分源代码奇迹世界 部分源代码奇迹世界 部分源代码
💻 CPP
字号:
#include "stdafx.h"
#include "SectorGroup.h"
#include "Sector.h"

////////////////////////////////////////////////////////////////////////////////////
// SectorGroup class 
////////////////////////////////////////////////////////////////////////////////////

SectorGroup::SectorGroup()
{
	m_pSectorHashTable = new util::SolarHashTable<Sector*>;
}

SectorGroup::~SectorGroup()
{
	SAFE_DELETE( m_pSectorHashTable );
}

VOID SectorGroup::Init( WORD wGroupIndex, WORD wSectorNumForGroup )
{
	m_pSectorHashTable->clear();
	m_pSectorHashTable->Initialize( wSectorNumForGroup );

	m_wGroupIndex = wGroupIndex;
	m_bReferenced = FALSE;
	m_iPlayerReferenceCount = 0;
}

VOID SectorGroup::Release()
{
	m_pSectorHashTable->clear();
	m_bReferenced = FALSE;
	m_iPlayerReferenceCount = 0;
}

VOID SectorGroup::AddSector( Sector *pSector )
{
	m_pSectorHashTable->Add( pSector, pSector->GetSectorIndex() );
}

VOID SectorGroup::SetReferenceCount( int iPlayerReferenceCount )
{
	// 茄锅捞扼档 敲饭捞绢啊 捞 冀磐弊缝阑 曼炼窍搁 m_bReferenced绰 TRUE啊 等促.
	if( iPlayerReferenceCount > 0 )
	{
		m_bReferenced = TRUE;
	}

	m_iPlayerReferenceCount = max( 0, iPlayerReferenceCount );
}

////////////////////////////////////////////////////////////////////////////////////
// SectorGroupList class 
////////////////////////////////////////////////////////////////////////////////////

SectorGroupList::SectorGroupList()
{
	m_wSectorUnitCount = _MAX_SECTOR_UNIT_COUNT;
	m_pSectorGroupHashTable = new util::SolarHashTable<SectorGroup *>;
}

SectorGroupList::~SectorGroupList()
{
	SAFE_DELETE( m_pSectorGroupHashTable );
}

VOID SectorGroupList::Release()
{
	m_pSectorGroupHashTable->RemoveAll();
}

VOID SectorGroupList::Init( WORD wTotalGroupNum )
{
	m_wTotalSectorGroupNum = wTotalGroupNum;
	m_pSectorGroupHashTable->Initialize( wTotalGroupNum );
}

VOID SectorGroupList::AddSectorGroup( SectorGroup *pSectorGroup )
{
	m_pSectorGroupHashTable->Add( pSectorGroup, pSectorGroup->GetGroupIndex() );
}

⌨️ 快捷键说明

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