Esempio n. 1
0
 private void PCAutoPlay()
 {
     if (YourBotTurn == false)
     {
         PushMessage("This is not your turn","Server");
         return;    
     }
     Point AIAutoMove = new Point();
     AI PC = new AI();
     PC.AIStart();
     if (GlobalVariable.fWin)
     {
         PC.Move((int)GlobalVariable.WinMove[0].Y, (int)GlobalVariable.WinMove[0].X);
         AIAutoMove = GlobalVariable.WinMove[0];
     }
     else
     {
         PC.EvalBoard(2);
         AIAutoMove = PC.MaxPos();
         PC.Move((int)AIAutoMove.Y, (int)AIAutoMove.X);
     }
     autoupdate(AIAutoMove); // update UI;
 }
Esempio n. 2
0
 public AIPlayer(Referee myReferee, int numPlayer)
     : base(myReferee, numPlayer)
 {
     _ai = new AI(_referee._board);
 }
Esempio n. 3
0
 private void PCMove()
 {
     //Thread.Sleep(5000);
     Point AIMove = new Point();
     AI PC = new AI();
     PC.AIStart();
     if (GlobalVariable.fWin)
     {
         PC.Move((int)GlobalVariable.WinMove[0].Y, (int)GlobalVariable.WinMove[0].X);
         AIMove = GlobalVariable.WinMove[0];
     }
     else
     {
         PC.EvalBoard(2);
         AIMove = PC.MaxPos();
         PC.Move((int)AIMove.Y, (int)AIMove.X);
     }
     //tính toán nước đi ở phía trên
     update(AIMove);
 }