www.pudn.com > notWow.rar > NPCMgr.h
#pragma once #include#include "Char.h" class NPCsManager { friend class Scene; vector m_NPCs; int m_MinPos; int m_nNPCs; public: // Initialize the Mgr void Init(); // Free the Mgr finally void Free(); NPCID AddNPC(const char* ModelName,MODELTYPE Type,ScriptID id); void Delete(NPCID id); inline Char* GetNPC(NPCID id); }; Char* NPCsManager::GetNPC(NPCID id) { if(id < 0 || id >= m_NPCs.size()) return NULL; if(m_NPCs[id].m_ObjectID == -1) return NULL; return &m_NPCs[id]; }