예제 #1
0
 // Neighboring square with food on it, if any (but only "far enough" from the nest)
 protected ZSquare squareWithFood(ZSquare excluded1, ZSquare excluded2) {
   for (ZSquare s : cells) {
     if (!s.isNest() && !s.isNextToNest() && s != excluded1 && s != excluded2 && s.hasFood())
       return s;
   }
   return null;
 }
예제 #2
0
 protected boolean isNextToNest() {
   return here.isNextToNest();
 }