示例#1
0
文件: Headless.java 项目: k1357536/ai
    @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;
    }
示例#2
0
文件: Headless.java 项目: k1357536/ai
    @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;
    }
示例#3
0
文件: Headless.java 项目: k1357536/ai
 @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;
 }