public void AddAgent(LSAgent agent) { ushort localID = GenerateLocalID(); LocalAgents [localID] = agent; LocalAgentActive [localID] = true; ushort globalID = GenerateGlobalID(); GlobalAgentActive [globalID] = true; GlobalAgents [globalID] = agent; agent.InitializeController(this, localID, globalID); }
public static void ChangeController(LSAgent agent, AgentController newCont) { AgentController leController = agent.Controller; leController.LocalAgentActive [agent.LocalID] = false; GlobalAgentActive[agent.GlobalID] = false; leController.OpenLocalIDs.Add(agent.LocalID); OpenGlobalIDs.Add(agent.GlobalID); if (newCont == null) { agent.InitializeController(null, 0, 0); } else { agent.Influencer.Deactivate(); newCont.AddAgent(agent); agent.Influencer.Initialize(); } }