Add loading options in JMenuBar
Need to fix bug when loading new maze with different dimensions
This commit is contained in:
1 parent
79ed877d9d
commit
7d5b2938fc
13 files changed
+51
-84
No files matched your search
@@ -2,25 +2,28 @@ package model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Observable;
|
||||
import java.util.Observer;
|
||||
|
||||
import dijkstra.VertexInterface;
|
||||
import dijkstra.Dijkstra;
|
||||
import dijkstra.Previous;
|
||||
|
||||
public class MazeAppModel extends Observable {
|
||||
|
||||
private Maze maze = new Maze("data/labyrinthe.txt");
|
||||
private VertexInterface departure = maze.getDeparture();
|
||||
private VertexInterface arrival = maze.getArrival();
|
||||
private Previous previous = (Previous) Dijkstra.dijkstra(maze, departure);
|
||||
private ArrayList<VertexInterface> shortest = previous.getShortestPathTo(arrival);
|
||||
private ArrayList<VertexInterface> boxList = maze.getVertexes();
|
||||
private Boolean modified = false;
|
||||
private Maze maze = new Maze("data/labyrinthe.txt");
|
||||
private VertexInterface departure = maze.getDeparture();
|
||||
private VertexInterface arrival = maze.getArrival();
|
||||
private Previous previous = (Previous) Dijkstra.dijkstra(maze, departure);
|
||||
private ArrayList<VertexInterface> shortest = previous.getShortestPathTo(arrival);
|
||||
private ArrayList<VertexInterface> boxList = maze.getVertexes();
|
||||
private Boolean modified = false;
|
||||
private ArrayList<Observer> listObserver = new ArrayList<Observer>();
|
||||
|
||||
public void setMaze(Maze maze) {
|
||||
this.maze = maze;
|
||||
modified = true;
|
||||
setChanged();
|
||||
notifyObservers();
|
||||
notifyObservers(maze);
|
||||
}
|
||||
|
||||
public Maze getMaze() {
|
||||
|
||||
Reference in new issue
Block a user