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