feat: enlever Circuit.java et toute ses impl

This commit is contained in:
2025-10-29 16:41:03 +01:00
parent f7677fec3b
commit 9ab1d6b960
3 changed files with 6 additions and 14 deletions

View File

@@ -1,3 +0,0 @@
public interface Circuit {
CircuitCell getType();
}

View File

@@ -4,7 +4,7 @@
* cases qui composent le circuit de * cases qui composent le circuit de
* course. * course.
*/ */
public enum CircuitCell implements Circuit { public enum CircuitCell {
/** /**
* Case hors piste, non * Case hors piste, non
* praticable par les * praticable par les
@@ -36,9 +36,4 @@ public enum CircuitCell implements Circuit {
* livrable 2 * livrable 2
*/ */
YROAD; YROAD;
@Override
public CircuitCell getType() {
return this;
}
} }

View File

@@ -3,10 +3,10 @@ import java.util.ArrayList;
public class Map public class Map
{ {
private Circuit[][] map; private CircuitCell[][] map;
private ArrayList<Point> pathMap; private ArrayList<Point> pathMap;
public Map(Circuit[][] map) private Map(CircuitCell[][] map)
{ {
this.map = map; this.map = map;
boolean isPossible = this.buildPath(); boolean isPossible = this.buildPath();
@@ -41,7 +41,7 @@ public class Map
{ {
for (int j = 0; j < map.length; j++) for (int j = 0; j < map.length; j++)
{ {
switch (map[i][j].getType()) switch (map[i][j])
{ {
case CircuitCell.START: case CircuitCell.START:
if (start == null) start = new Point(j, i); if (start == null) start = new Point(j, i);
@@ -100,7 +100,7 @@ public class Map
if (next.equals(previous)) if (next.equals(previous))
continue; continue;
CircuitCell type = map[y][x].getType(); CircuitCell type = map[y][x];
if ((type == CircuitCell.ROAD || type == CircuitCell.YROAD) || if ((type == CircuitCell.ROAD || type == CircuitCell.YROAD) ||
(type == CircuitCell.FINISH && map[current.y][current.x] == CircuitCell.ROAD)) (type == CircuitCell.FINISH && map[current.y][current.x] == CircuitCell.ROAD))
{ {
@@ -119,7 +119,7 @@ public class Map
return false; return false;
} }
public Circuit getElement(int x, int y) public CircuitCell getElement(int x, int y)
{ {
return map[y][x]; return map[y][x];
} }