Beispiel #1
0
 public override void AI_move(cell moveto)
 {
     base.AI_move(moveto);
     if (can_do_castling == true)
     {
         if (_currentCell == ChessBoard.Current.cells[6][7])
         {
             Castle p = ChessBoard.Current.cells[7][7].CurrentPiece as Castle;
             p.Castling(Side, false);
         }
         else if (_currentCell == ChessBoard.Current.cells[2][7])
         {
             Castle p = ChessBoard.Current.cells[0][7].CurrentPiece as Castle;
             p.Castling(Side, true);
         }
         else
         {
             can_do_castling = false;
         }
     }
 }
Beispiel #2
0
 protected override void OnMouseUp()
 {
     base.OnMouseUp();
     if (can_do_castling == true)
     {
         if (_currentCell == ChessBoard.Current.cells[6][0])
         {
             Castle p = ChessBoard.Current.cells[7][0].CurrentPiece as Castle;
             p.Castling(Side, false);
         }
         else if (_currentCell == ChessBoard.Current.cells[2][0])
         {
             Castle p = ChessBoard.Current.cells[0][0].CurrentPiece as Castle;
             p.Castling(Side, true);
         }
         else
         {
             can_do_castling = false;
         }
     }
     BaseGameCTL.Current.AI_turn();
 }