add Save Text support and rework package

- move maze within package maze
This commit is contained in:
philippe lhardy
2020-10-17 21:08:16 +02:00
parent c3410838e1
commit c69d068caf
24 changed files with 590 additions and 385 deletions

View File

@@ -0,0 +1,70 @@
package org.artisanlogiciel.games.maze;
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;
}
}