public boolean isFull() { for (XY xy : XY.allXYs()) { if (this.get(xy) == ScribeMark.EMPTY) return false; } return true; }
/** @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; }
MiniGrid() { data = new ScribeMark[3][3]; for (XY xy : XY.allXYs()) { data[xy.y][xy.x] = ScribeMark.EMPTY; } }