Exemple #1
0
    @Override
    public boolean test(Node node) {
      V pos = (V) node.getState();
      for (GameObject go : board.at(pos)) {
        if (go instanceof Fountain) {
          if (((Fountain) go).lastVisitedBy != me.id) return true;
        }
      }

      return false;
    }
Exemple #2
0
    @Override
    public boolean test(Node currentNode) {
      V currentUnicornPos = (V) currentNode.getState();
      for (V d : Board.getDirections()) {
        for (GameObject obj : board.at(V.add(currentUnicornPos, d))) {
          if (obj instanceof Cloud) {
            return true;
          }
        }
      }

      return false;
    }
Exemple #3
0
 @Override
 public boolean test(Node node) {
   V pos = (V) node.getState();
   // for all seeds
   for (Seed s : board.getSeeds()) {
     // are we on the same (axis parallel) line ?
     if (V.sameLine(pos, s.pos)) {
       // are we far enough from it ?
       if (V.manhattan(pos, s.pos) < s.range) {
         return false;
       }
     }
   }
   return true;
 }