Exemple #1
0
 private GameObj shiftChecker(GameObj obj, int x, int y) {
   Color c = obj.getColor();
   Checker ret = new Checker(x, y, c);
   if (obj.isQueen()) {
     ret.makeQueen();
   }
   return ret;
 }
Exemple #2
0
 private boolean canDoubleJump(GameObj obj) {
   doubleJumpSpots = new ArrayList<Tuple<Integer, Integer>>();
   if (obj.isTile()) {
     return false;
   }
   int x = obj.getX();
   int y = obj.getY();
   if (obj.isQueen()) {
     return doubleJumpProcess(obj, x + 2, y + 2)
         || doubleJumpProcess(obj, x - 2, y + 2)
         || doubleJumpProcess(obj, x + 2, y - 2)
         || doubleJumpProcess(obj, x - 2, y - 2);
   } else {
     if (turn.equals(Color.RED)) {
       return doubleJumpProcess(obj, x + 2, y - 2) || doubleJumpProcess(obj, x - 2, y - 2);
     } else {
       return doubleJumpProcess(obj, x + 2, y + 2) || doubleJumpProcess(obj, x - 2, y + 2);
     }
   }
 }