// remove all NPCs from the map void NPCManager::removeNpcsFromMap(uint16_t mapID) { map<uint8_t, NPC*>::const_iterator iter = m_npcMap.begin(); for(; iter != m_npcMap.end(); ++iter) { NPC* pNPC = iter->second; if(pNPC->getMapID() == mapID) { pNPC->removeFromMap(); } } }
// show NPC on the specified map void NPCManager::showNpcOnMap(uint16_t mapID, CCNode* pParent) { map<uint8_t, NPC*>::iterator iter = m_npcMap.begin(); for(; iter != m_npcMap.end(); ++iter) { NPC* pNPC = iter->second; if(pNPC->getMapID() == mapID) { pNPC->showOnMap(pParent); } } }