// -------------------------------------------------------------------------- // CHANGE LISTENERS: // -------------------------------------------------------------------------- public void onChange(BoardModel board) { for (int i = 0; i < board.getRowsOnBoard(); i++) { for (int j = 0; j < board.getColsOnBoard(); j++) { TileModel square = tiles.get(i).get(j); square.setTileState(board.getTileState(i, j)); } } }
public void update(float dt) { super.update(dt); if (!doneInitializing) return; for (int i = 0; i < board.getRowsOnBoard(); i++) { for (int j = 0; j < board.getColsOnBoard(); j++) { tiles.get(i).get(j).update(dt); } } }
public void draw(Canvas canvas) { if (canvas == null) return; canvas.drawColor(Color.rgb(151, 177, 174)); if (!doneInitializing || canvas == null) return; for (int i = 0; i < board.getRowsOnBoard(); i++) { for (int j = 0; j < board.getColsOnBoard(); j++) { tiles.get(i).get(j).draw(canvas); } } }