pokemon-cmd/java/Structure.java
EpicKnarvik97 9a3a01c082 Added more stuff in test.
We are still missing the actual function to place a structure on the map, but we are quite close.
2017-11-30 18:40:13 +01:00

39 lines
701 B
Java

import java.util.ArrayList;
public class Structure {
private static ArrayList<Structure> structures = new ArrayList<Structure>();
private Tile[][] tiles;
private String name;
public Structure(String name, Tile[][] tiles) {
this.name = name;
this.tiles = tiles;
structures.add(this);
}
public String getName() {
return this.name;
}
public Tile[][] getTiles() {
return this.tiles;
}
public static ArrayList<Structure> getStructures() {
return structures;
}
public int getWidth() {
return this.tiles.length;
}
public int getHeight() {
int max = 0;
for (Tile[] tile : this.tiles) {
if (tile.length > max) {
max = tile.length;
}
}
return max;
}
}