public void Execute(Command com) { if (com.ContainsData <Selection> ()) { previousSelection = com.GetData <Selection> (); } BehaviourHelperManager.Execute(com); Selection selection = GetSelection(com); for (int i = 0; i < selection.selectedAgentLocalIDs.Count; i++) { ushort selectedAgentID = selection.selectedAgentLocalIDs [i]; if (LocalAgentActive [selectedAgentID]) { var agent = LocalAgents [selectedAgentID]; //Prevent executing twice on commander if (Commander.IsNull() || agent != Commander.Agent) { agent.Execute(com); } } } if (Commander.IsNotNull()) { Commander.Agent.Execute(com); } }
public void Execute(Command com) { if (com.ContainsData <Selection>()) { previousSelection = com.GetData <Selection>(); } BehaviourHelperManager.Execute(com); Selection selection = GetSelection(com); for (int i = 0; i < selection.selectedAgentLocalIDs.Count; i++) { ushort selectedAgentID = selection.selectedAgentLocalIDs [i]; if (LocalAgentActive [selectedAgentID]) { LocalAgents [selectedAgentID].Execute(com); } } }
internal static void Execute(Command com) { if (!GameStarted) { Debug.LogError("BOOM"); return; } if (com.ControllerID != byte.MaxValue) { AgentController cont = AgentController.InstanceManagers [com.ControllerID]; cont.Execute(com); } else { BehaviourHelperManager.Execute(com); } DefaultMessageRaiser.Execute(com); }
public void Execute(Command com) { { if (com.ContainsData <Selection>() == false) { com.Add <Selection>(previousSelection); } previousSelection = com.GetData <Selection>(); } BehaviourHelperManager.Execute(com); for (int i = 0; i < com.GetData <Selection>().selectedAgentLocalIDs.Count; i++) { ushort selectedAgentID = com.GetData <Selection>().selectedAgentLocalIDs [i]; if (LocalAgentActive [selectedAgentID]) { LocalAgents [selectedAgentID].Execute(com); } } }