Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ public RaceResponse simulatePathfinding(PathfindingSimulationRequest request) {
weights = sanitizeWeights(request.weights(), rows, cols);
} else {
weights =
MazeGenerator.generateWeights(
rows, cols, MazeGenerator.fromName(request.mazeType()));
MazeGenerator.generateWeights(rows, cols, MazeGenerator.fromName(request.mazeType()));
}

List<String> algos = sanitizeAlgorithms(request.algorithms());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public static boolean[][] generate(
case PRIM -> prims(rows, cols);
case RECURSIVE_DIVISION -> recursiveDivision(rows, cols);
case CELLULAR_AUTOMATA -> cellularAutomata(rows, cols);
case WEIGHTED_TERRAIN_MAP -> new boolean[rows][cols]; // Terrain maps rely on weights, not walls
case WEIGHTED_TERRAIN_MAP ->
new boolean[rows][cols]; // Terrain maps rely on weights, not walls
};
clearArea(walls, startRow, startCol, rows, cols);
clearArea(walls, endRow, endCol, rows, cols);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void testPathfindingBlockedEndNode() {
void testSimulationServicePathfinding() {
PathfindingSimulationRequest request =
new PathfindingSimulationRequest(
algorithms, 10, 10, "Clear Grid", null, null, null, null, null);
algorithms, 10, 10, "Clear Grid", null, null, null, null, null, null);

RaceResponse response = simulationService.simulatePathfinding(request);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ void searching_outOfBoundsSize_badRequest() throws Exception {
@Test
void pathfinding_validRequest_success() throws Exception {
PathfindingSimulationRequest request =
new PathfindingSimulationRequest(List.of("BFS"), 20, 20, "Clear Grid", null, null, 0, 0, 19, 19);
new PathfindingSimulationRequest(
List.of("BFS"), 20, 20, "Clear Grid", null, null, 0, 0, 19, 19);

RaceResponse response =
new RaceResponse("pathfinding", null, null, null, null, new ArrayList<>(), null);
Expand Down Expand Up @@ -158,7 +159,8 @@ void pathfinding_emptyAlgorithms_badRequest() throws Exception {
@Test
void pathfinding_outOfBoundsDimensions_badRequest() throws Exception {
PathfindingSimulationRequest request =
new PathfindingSimulationRequest(List.of("BFS"), 7, 20, "Clear Grid", null, null, 0, 0, 6, 19);
new PathfindingSimulationRequest(
List.of("BFS"), 7, 20, "Clear Grid", null, null, 0, 0, 6, 19);

mockMvc
.perform(
Expand Down
Loading