Files
artloglaby/java/org/artisanlogiciel/games/MazeParamEditor.java
philippe lhardy 96c72506fb Add java.util.random seed as initial parameter
- prepare for short save allowing to fully recreate initial lab
having only seed and x,y,depth paramters
2020-10-11 12:44:22 +02:00

71 lines
1.0 KiB
Java

package org.artisanlogiciel.games;
import java.io.File;
import java.util.Scanner;
/**
MazeParamEditor to edit Maze Parameters ( current impl in console / Scanner )
**/
class MazeParamEditor implements MazeParams
{
long seed;
int width;
int height;
int maxdepth;
File labdir;
String name;
public MazeParamEditor(File saveDir)
{
name = null;
labdir = saveDir;
}
public void read(Scanner console)
{
width = console.nextInt();
height = console.nextInt();
maxdepth = console.nextInt();
}
public long getSeed()
{
return seed;
}
public int getWidth()
{
return width;
}
public int getHeight()
{
return height;
}
public int getMaxDepth()
{
return maxdepth;
}
public String getName()
{
if (name == null)
{
name = "lab" + width + "x" + height;
}
return name;
}
public void setSeed(long seed)
{
this.seed = seed;
}
public File getSaveDir()
{
return labdir;
}
}