public void SingleCCTurn(InternalSimulator TestSim, int cc, int Player)
 {
     if (cc == -1)
     {
         while (TestSim.Turn() == Player && !TestSim.Finished())
         {
             IDT.setObjectArgs(TestSim.GetData(Player));
             IDT.SetState(true);
             BaseL.GetArrays();
             BaseL.ForceNodeClustersToGetData();
             BaseL.NodeCalculations();
             TestSim.SetCommand(BaseL.GetAllDecisions());
             IDT.SetState(false);
             currentCommandNumber = TestSim.ReturnChosenCommand();
             CCLog(this, new CommandCArgs(new int[] { currentCommandNumber, Player }));
         }
     }
     else
     {
         while (TestSim.Turn() == Player && !TestSim.Finished())
         {
         }
         IDT.setObjectArgs(TestSim.GetData(Player));
         IDT.SetState(true);
         CC[cc].GetArrays();
         CC[cc].ForceNodeClustersToGetData();
         CC[cc].NodeCalculations();
         TestSim.SetCommand(CC[cc].GetAllDecisions());
         IDT.SetState(false);
         currentCommandNumber = TestSim.ReturnChosenCommand();
         CCLog(this, new CommandCArgs(new int[] { currentCommandNumber, Player }));
         if (PlayMode == 0)
         {
             CC[cc].LogCluster(currentCommandNumber);
         }
     }
 }
 public int InternalAITurn(InternalSimulator TestSim)
 {
     if (CC != null)
     {
         if (!TestSim.Finished())
         {
             if (PlayerMode == 1)
             {
                 // The human is always player 1, the AI take up the remaining players
                 int Move = 0;
                 for (int i = 0; i < CC.Length; i++)
                 {
                     if (TestSim.Turn() == i + 2)
                     {
                         Move = i;
                     }
                 }
                 while (TestSim.Turn() == Move + 2 && !TestSim.Finished())
                 {
                     IDT.setObjectArgs(TestSim.GetData(Move + 2));
                     IDT.SetState(true);
                     CC[Move].GetArrays();
                     CC[Move].ForceNodeClustersToGetData();
                     CC[Move].NodeCalculations();
                     //CC[Move].LegacyNodeCalculations();
                     TestSim.SetCommand(CC[Move].GetAllDecisions());
                     IDT.SetState(false);
                     currentCommandNumber = TestSim.ReturnChosenCommand();
                     CCLog(this, new CommandCArgs(new int[] { currentCommandNumber, Move + 2 }));
                     if (PlayMode == 0)
                     {
                         CC[Move].LogCluster(currentCommandNumber);
                     }
                 }
             }
             else if (PlayerMode == 2)
             {
                 int Move = 0;
                 for (int i = 0; i < CC.Length; i++)
                 {
                     if (TestSim.Turn() == i + 1)
                     {
                         Move = i;
                     }
                 }
                 while (TestSim.Turn() == Move + 1 && !TestSim.Finished())
                 {
                     IDT.setObjectArgs(TestSim.GetData(Move + 1));
                     IDT.SetState(true);
                     CC[Move].GetArrays();
                     CC[Move].ForceNodeClustersToGetData();
                     CC[Move].NodeCalculations();
                     TestSim.SetCommand(CC[Move].GetAllDecisions());
                     IDT.SetState(false);
                     currentCommandNumber = TestSim.ReturnChosenCommand();
                     CCLog(this, new CommandCArgs(new int[] { currentCommandNumber, Move + 1 }));
                     if (PlayMode == 0)
                     {
                         CC[Move].LogCluster(currentCommandNumber);
                     }
                 }
             }
             else if (PlayerMode == 3)
             {
                 int Move = 0;
                 for (int i = 0; i < CC.Length; i++)
                 {
                     if (TestSim.Turn() == i + 2)
                     {
                         Move = i;
                     }
                 }
                 while (TestSim.Turn() == Move + 2 && !TestSim.Finished())
                 {
                     IDT.setObjectArgs(TestSim.GetData(Move + 2));
                     IDT.SetState(true);
                     CC[Move].GetArrays();
                     CC[Move].ForceNodeClustersToGetData();
                     CC[Move].NodeCalculations();
                     TestSim.SetCommand(CC[Move].GetAllDecisions());
                     IDT.SetState(false);
                     currentCommandNumber = TestSim.ReturnChosenCommand();
                     CCLog(this, new CommandCArgs(new int[] { currentCommandNumber, Move }));
                     if (PlayMode == 0)
                     {
                         CC[Move].LogCluster(currentCommandNumber);
                     }
                 }
             }
             return(currentCommandNumber);
         }
         else
         {
             return(-1);
         }
     }
     else
     {
         return(-1);
     }
 }