Dungeon.buildDungeon() now properly initializes Gaps & the Replicator

This commit is contained in:
Kjistóf 2016-04-25 20:59:28 +02:00
parent 328107adb8
commit 339df6af13

View File

@ -33,6 +33,7 @@ public class Dungeon {
{
Tile oneilllocation = null;
Tile jaffalocation = null;
Tile replicatorlocation = null;
try(BufferedReader reader = new BufferedReader(new FileReader(input)))
{
String[] sizedata = reader.readLine().split("x"); // read size data at beginning of file
@ -93,6 +94,16 @@ public class Dungeon {
dungeon[y][x] = tempscale;
scalecount++;
break;
case 'X':
dungeon[y][x] = new Gap();
break;
case 'R':
Field replicatorfield = new Field();
dungeon[y][x] = replicatorfield;
replicatorlocation = replicatorfield;
break;
}
}
}
@ -139,6 +150,7 @@ public class Dungeon {
Map<String, Tile> playermap = new HashMap<>();
playermap.put("oneill", oneilllocation);
playermap.put("jaffa", jaffalocation);
playermap.put("replicator", replicatorlocation);
return playermap;
}