Stored height alongside width in dungeon

This commit is contained in:
Bokros Bálint 2016-05-14 02:48:19 +02:00 committed by Kjistóf
parent a9263a41e4
commit b5df8cfcaf

View File

@ -8,6 +8,7 @@ public class Dungeon {
private int ZPMsToWin = 0; private int ZPMsToWin = 0;
private long timeLimit = 0; private long timeLimit = 0;
private int mapWidth = 0; private int mapWidth = 0;
private int mapHeight = 0;
/* NOTE: this function assumes that the parameter input is a well-formatted dungeon file. /* NOTE: this function assumes that the parameter input is a well-formatted dungeon file.
@ -55,6 +56,7 @@ public class Dungeon {
int height = Integer.parseInt(sizedata[1]); int height = Integer.parseInt(sizedata[1]);
mapWidth = width; // remember this value mapWidth = width; // remember this value
mapHeight = height;
Tile[][] dungeon = new Tile[width][height]; Tile[][] dungeon = new Tile[width][height];
@ -207,4 +209,8 @@ public class Dungeon {
public int getMapWidth() { public int getMapWidth() {
return mapWidth; return mapWidth;
} }
public int getMapHeight() {
return mapHeight;
}
} }