Ajout de la Grille

This commit is contained in:
2023-04-11 09:45:48 +02:00
parent 0a0e0342d7
commit c8f37a583a
4 changed files with 119 additions and 0 deletions

29
src/GridController.java Normal file
View File

@@ -0,0 +1,29 @@
public class GridController {
private Grid model;
private GridView view;
public GridController(Grid model, GridView view) {
this.model = model;
this.view = view;
}
public void setGridExit(int x, int y) {
this.model.setExit(x, y);
}
public void setGridWall(int x, int y) {
this.model.setWall(x, y);
}
public boolean isGridWall(int x, int y) {
return this.model.isWall(x, y);
}
public boolean isGridExit(int x, int y) {
return this.model.isExit(x, y);
}
public void updateView() {
this.view.printGridInfo(this.model.getRows(), this.model.getColumns());
}
}