Пример #1
0
BOOL KPlayerMgr::RemoveById( DWORD dwId )
{
	KPlayer* pPlayer = m_cObjMgr.GetById(dwId);
	QCONFIRM_RET_FALSE(pPlayer);

	// 擦除映射表
	m_mapNameToPlayer.erase(pPlayer->GetStrName());
	pPlayer->Uninit();

	return m_cObjMgr.Remove(dwId);
}
Пример #2
0
BOOL KPlayerMgr::RemoveByIndex( INT nIndex )
{
	KPlayer* pPlayer = m_cObjMgr.GetByIndex(nIndex);
	QCONFIRM_RET_FALSE(pPlayer);

	// 擦除映射表
	m_mapNameToPlayer.erase(pPlayer->GetStrName());
	pPlayer->Uninit();

	return m_cObjMgr.RemoveByIndex(nIndex);
}