Beispiel #1
0
        public bool AddNPCModule(INPCModule mod)
        {
            if (g_NPCModules == null)
            {
                g_NPCModules = new Dictionary <string, INPCModule>();
            }
            if (g_NPCModules.ContainsKey(mod.NPCModuleName()))
            {
                return(false);
            }
            switch (mod.NPCModuleTarget())
            {
            case NPC_MODULE_TARGET.AI:
                gAI.SetNPCModule(mod);
                break;

            case NPC_MODULE_TARGET.BODY:
                break;

            case NPC_MODULE_TARGET.PERCEPTION:
                break;
            }
            g_NPCModules.Add(mod.NPCModuleName(), mod);
            return(true);
        }
Beispiel #2
0
 public void RemoveNPCModule(INPCModule mod)
 {
     if (g_NPCModules.ContainsKey(mod.NPCModuleName()))
     {
         g_NPCModules.Remove(mod.NPCModuleName());
     }
 }
 public void SetNPCModule(INPCModule mod)
 {
     if (gPathfinders == null)
     {
         InitPathfinders();
     }
     switch (mod.NPCModuleType())
     {
     case NPC_MODULE_TYPE.PATHFINDER:
         gPathfinders.Add(mod.NPCModuleName(), mod as INPCPathfinder);
         break;
     }
 }
Beispiel #4
0
 public bool ContainsModule(INPCModule mod)
 {
     return(g_NPCModules != null && g_NPCModules.ContainsKey(mod.NPCModuleName()));
 }