LabyModel limit public constructors to
LabyModel(MazeParams params, Random random) and LabyModel(String pFormat, InputStream pIn) fix unchecked and (java9) deprecated Short(short)
This commit is contained in:
@@ -14,25 +14,13 @@ public class Main
|
||||
return editor;
|
||||
}
|
||||
|
||||
public WallsProvider generate(int width, int height, int maxdepth, MazeResolutionListener listener)
|
||||
public LabyMap generate2(MazeParamEditor params)
|
||||
{
|
||||
LabyModel model = new LabyModel(width, height, maxdepth, new java.util.Random());
|
||||
LabyModel model = new LabyModel(params, new java.util.Random(1024L));
|
||||
model.generateWithEntry(0, 0);
|
||||
LinkedList<Position> exits = new LinkedList<Position>();
|
||||
model.addEntryOrExit(-1, 0);
|
||||
model.addEntryOrExit(width, height - 1);
|
||||
if (!model.check())
|
||||
{
|
||||
System.out.println("Check failed");
|
||||
}
|
||||
model.resolve(width - 1, height - 1, listener);
|
||||
return model;
|
||||
}
|
||||
|
||||
public LabyMap generate2(int width, int height, int maxdepth)
|
||||
{
|
||||
LabyModel model = new LabyModel(width, height, maxdepth, new java.util.Random(1024L));
|
||||
model.generateWithEntry(0, 0);
|
||||
final int width = params.getWidth();
|
||||
final int height = params.getHeight();
|
||||
LinkedList<Position> exits = new LinkedList<Position>();
|
||||
model.addEntryOrExit(-1, 0);
|
||||
model.addEntryOrExit(width, height - 1);
|
||||
@@ -51,7 +39,7 @@ public class Main
|
||||
{
|
||||
Main m = new Main();
|
||||
MazeParamEditor editor = m.editor();
|
||||
LabyMap map = m.generate2(editor.width, editor.height, editor.maxdepth);
|
||||
LabyMap map = m.generate2(editor);
|
||||
System.out.println(map.toShortString());
|
||||
System.out.println(map.toString());
|
||||
System.out.println(Brick.getDirLine());
|
||||
|
||||
Reference in New Issue
Block a user