Exemplo n.º 1
0
 private int calculateQuiescenceDepth(Board board,
                                      int depth)
 {
     if (depth == 1 && this.quiescenceCount < MAX_QUIESCENCE)
     {
         int activityMeasure = 0;
         if (board.getCurrentPlayer().isCheck())
         {
             activityMeasure += 1;
         }
         foreach (Move move in BoardUtils.lastNMoves(board, 2))
         {
             if (move.isAttack())
             {
                 activityMeasure += 1;
             }
         }
         if (activityMeasure >= 2)
         {
             this.quiescenceCount++;
             return(1);
         }
     }
     return(depth - 1);
 }