Stored height alongside width in dungeon
This commit is contained in:
		@@ -8,6 +8,7 @@ public class Dungeon {
 | 
			
		||||
    private int ZPMsToWin = 0;
 | 
			
		||||
    private long timeLimit = 0;
 | 
			
		||||
    private int mapWidth = 0;
 | 
			
		||||
    private int mapHeight = 0;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /* 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]);
 | 
			
		||||
 | 
			
		||||
            mapWidth = width;   // remember this value
 | 
			
		||||
            mapHeight = height;
 | 
			
		||||
 | 
			
		||||
            Tile[][] dungeon = new Tile[width][height];
 | 
			
		||||
 | 
			
		||||
@@ -207,4 +209,8 @@ public class Dungeon {
 | 
			
		||||
    public int getMapWidth() {
 | 
			
		||||
        return mapWidth;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public int getMapHeight() {
 | 
			
		||||
        return mapHeight;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user