public class controller{ int row, col; snakeGame game; snakeGameView gui; public boolean started = false; public boolean startedOnce = false; public controller(int row, int col){ this.row = row; this.col = col; game = new snakeGame(row, col); gui = new snakeGameView(this); } public boolean getGameOver() { return game.getGameOver(); } public int getScore(){ return game.getScore(); } public int getDirection(){ return game.direction; } public snake getSnake(){ return game.getSnake(); } public board getBoard(){ return game.getBoard(); } public cell getNextcell(cell currentPos){ return getNextcell(currentPos); } public void addScore(){ game.addScore(); } public void setDirection(int direction){ game.setDirection(direction); } public void setGameOver(boolean cond){ game.setGameOver(cond); } public cell getCell(int row, int col){ return game.board.getCell(row, col); } public void update(){ game.update(); } public int getRow(){ return row; } public int getCol(){ return col; } }