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:
philippe lhardy
2018-06-14 22:49:39 +02:00
parent 2d3f7b01a0
commit fbe4a3e133
5 changed files with 128 additions and 127 deletions

View File

@@ -0,0 +1,69 @@
package org.artisanlogiciel.games;
import java.io.File;
public class MazeParamsFixed implements MazeParams
{
int width;
int height;
int maxdepth;
File labdir;
String name;
public MazeParamsFixed()
{
}
public MazeParamsFixed(MazeParams params)
{
setParams(params.getSaveDir(),params.getWidth(),params.getHeight(),params.getMaxDepth());
}
public void setParams(File saveDir, int W, int H, int MD)
{
labdir = saveDir;
width=W;
height=H;
maxdepth=MD;
}
public MazeParamsFixed(File saveDir, int W, int H, int MD)
{
name = null;
setParams(saveDir,W,H,MD);
}
public int getWidth()
{
return width;
}
public int getHeight()
{
return height;
}
public int getMaxDepth()
{
return maxdepth;
}
public void setName(String n)
{
name = n;
}
public String getName()
{
if (name == null)
{
name = "lab" + width + "x" + height;
}
return name;
}
public File getSaveDir()
{
return labdir;
}
}