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); }
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); }