}
if (constraints == null) {
CountConstraints cons = null;
dungeonView = new GridDungeonView();
if (getArg("space") != null) {
try {
SpaceMap spaceMap = new SpaceMap();
BufferedImage img = ImageIO.read(new File(getArg("space")));
for (int x = 0; x < img.getWidth(); ++x)
for (int y = 0; y < img.getHeight(); ++y) {
if ((img.getRGB(x,y) & 0xFFFFFF) != 0) {
spaceMap.set(new Coords(x,y), true);
}
}
cons = new SpaceConstraints(spaceMap);
} catch (IOException e) {
e.printStackTrace();
System.err.println("Falling back on CountConstraints");
}
}
if (cons == null)
cons = new CountConstraints(25, 4, 1);
if (getArg("switches") == null)
cons.setMaxSwitches(0);
constraints = cons;
}
DungeonGenerator generator;