/** * Callback from the Grid objects, for when the button gets pressed. This is really an example of * cyclic dependency, but, we'd need to use some more object-oriented features to do a good job * fixing it. * * @param grid Grid object that was clicked on. * @param row row of the grid that was clicked * @param column column of the grid that was clicked */ public void gridPress(Grid grid, int row, int column) { if (grid == humanGrid) { game.selectHumanGridSquare(row, column); } else { game.selectComputerGridSquare(row, column); } updateStatus(); repaint(); }