示例#1
0
 boolean checkRight(int checkX, int checkY) {
   for (; checkX < 9; checkX++) {
     if (bf.scanQuadrant2(checkY, checkX) instanceof Rock
         || af.getQuadrantString(checkX, checkY).equals(enemyTankPosition())) {
       return true;
     }
   }
   return false;
 }
示例#2
0
 public int battleFieldScanner() {
   for (int fieldX = 0; fieldX < bf.getDimentionX(); fieldX++) {
     for (int fieldY = 0; fieldY < bf.getDimentionY(); fieldY++)
       if ((af.getQuadrantString(fieldX, fieldY).equals(enemyTankPosition()))
           || (bf.scanQuadrant2(fieldY, fieldX) instanceof Rock)) {
         return fieldX + 1;
       }
   }
   return 0;
 }