Add and fix tests for the Serializers.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Manuel Friedli 2024-12-18 01:03:53 +01:00
parent 5a642b354b
commit 3bf438ffb9
Signed by: manuel
GPG key ID: 41D08ABA75634DA1
4 changed files with 107 additions and 0 deletions

View file

@ -86,6 +86,21 @@ public class Wilson extends AbstractMazeGeneratorAlgorithm {
direction = determineDirectionForDigging(maze.getEnd());
t = maze.getEndTile();
this.digTo(t, direction);
// seal all walls, mark all as visited
for (int x = 0; x < maze.getWidth(); x++) {
for (int y = 0; y < maze.getHeight(); y++) {
maze.getTileAt(x, y).forEach(tile -> {
Stream.of(Direction.values())
.forEach(d -> {
if (tile.hasWallAt(d)) {
tile.preventDiggingToOrFrom(d);
} else {
tile.digFrom(d);
}
});
});
}
}
}
@Nullable