import java.util.Observable; public class Maze extends Observable { private int MAX_ROW, MAX_COL; private Room[][] maze; private int playerRow, playerCol; // current position of the player private int exitRow, exitCol; // position of exit private int playerMoves = 0; /** * @param max_row * @param max_col */ public Maze(int max_row, int max_col) { super(); MAX_ROW = max_row; MAX_COL = max_col; maze = new Room[MAX_ROW][MAX_COL]; playerRow = 0; playerCol = 0; exitRow = (int)Math.random() * MAX_ROW; exitCol = (int)Math.random() * MAX_COL; playerMoves = 0; } /** * @return the mAX_ROW */ public int getMAX_ROW() { return MAX_ROW; } /** * @param max_row the mAX_ROW to set */ public void setMAX_ROW(int max_row) { MAX_ROW = max_row; setChanged(); notifyObservers(); } /** * @return the mAX_COL */ public int getMAX_COL() { return MAX_COL; } /** * @return the playerRow */ public int getPlayerRow() { return playerRow; } /** * @param playerRow the playerRow to set */ public void setPlayerRow(int playerRow) { this.playerRow = playerRow; setChanged(); notifyObservers(); } /** * @return the playerCol */ public int getPlayerCol() { return playerCol; } /** * @param playerCol the playerCol to set */ public void setPlayerCol(int playerCol) { this.playerCol = playerCol; setChanged(); notifyObservers(); } /** * @return the exitRow */ public int getExitRow() { return exitRow; } /** * @param exitRow the exitRow to set */ public void setExitRow(int exitRow) { this.exitRow = exitRow; setChanged(); notifyObservers(); } /** * @return the exitCol */ public int getExitCol() { return exitCol; } /** * @param exitCol the exitCol to set */ public void setExitCol(int exitCol) { this.exitCol = exitCol; setChanged(); notifyObservers(); } /** * @return the playerMoves */ public int getPlayerMoves() { return playerMoves; } /** * @param playerMoves the playerMoves to set */ public void setPlayerMoves(int playerMoves) { this.playerMoves = playerMoves; setChanged(); notifyObservers(); } }