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 static void Execute(Command com)
 {
     if (com.ContainsData <Vector2d> ())
     {
         CreateGroup(com);
     }
 }
Example #3
0
 protected override void OnExecute(Command com)
 {
     LastCommand = com;
     if (com.ContainsData <Vector2d>())
     {
         StartFormalMove(com.GetData <Vector2d>());
     }
 }
 public Selection GetSelection(Command com)
 {
     if (com.ContainsData <Selection>() == false)
     {
         return(previousSelection);
     }
     return(com.GetData <Selection>());
 }
Example #5
0
 protected override void OnExecute(Command com)
 {
     if (com.ContainsData <Vector2d> ())
     {
         Agent.StopCast(ID);
         RegisterGroup();
         if (straightPath)
         {
             repathCount /= 8;
         }
         else
         {
             repathCount /= 8;
         }
     }
 }
        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);
                }
            }
        }
Example #7
0
        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);
                }
            }
        }