engine: allow non-default sized maps to be instantiated
git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@598 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
parent
e80daa30de
commit
efd0326db2
1 changed files with 8 additions and 6 deletions
|
@ -211,16 +211,18 @@ public class Micropolis
|
||||||
|
|
||||||
public Micropolis()
|
public Micropolis()
|
||||||
{
|
{
|
||||||
PRNG = DEFAULT_PRNG;
|
this(DEFAULT_WIDTH, DEFAULT_HEIGHT);
|
||||||
evaluation = new CityEval(this);
|
|
||||||
init();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void init()
|
public Micropolis(int width, int height)
|
||||||
{
|
{
|
||||||
int width = DEFAULT_WIDTH;
|
PRNG = DEFAULT_PRNG;
|
||||||
int height = DEFAULT_HEIGHT;
|
evaluation = new CityEval(this);
|
||||||
|
init(width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void init(int width, int height)
|
||||||
|
{
|
||||||
map = new char[height][width];
|
map = new char[height][width];
|
||||||
powerMap = new boolean[height][width];
|
powerMap = new boolean[height][width];
|
||||||
|
|
||||||
|
|
Reference in a new issue