예제 #1
0
  public boolean isFull() {
    for (XY xy : XY.allXYs()) {
      if (this.get(xy) == ScribeMark.EMPTY) return false;
    }

    return true;
  }
예제 #2
0
 /** @return A list of all the positions on this MiniGrid that are still empty. */
 public List<XY> getEmptyCells() {
   List<XY> emptyCells = new ArrayList<XY>();
   for (XY xy : XY.allXYs()) {
     if (this.get(xy) == ScribeMark.EMPTY) {
       emptyCells.add(xy);
     }
   }
   return emptyCells;
 }
예제 #3
0
 MiniGrid() {
   data = new ScribeMark[3][3];
   for (XY xy : XY.allXYs()) {
     data[xy.y][xy.x] = ScribeMark.EMPTY;
   }
 }