Class BuildingGenerator
java.lang.Object
com.deco2800.game.areas.MapGenerator.Buildings.BuildingGenerator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a copy of this BuildingGenerator's buildingspec listchar[][]
Returns char char array of the current city contents in the CityRowsint
Returns the number of tiles buildings are placed from each other.int
Gets the city height.Returns a copy of this BuildingGenerators CityRow list - used to find building placementsint
Gets the city width.Returns the PathGenerator instance.int
Returns the number of tiles buildings are placed from the right wall.int
Returns the number of tiles buildings are placed from each other on the y axis.int
Returns the number of tiles buildings are placed from the wall.void
void
writeCity
(int cityHeight, int cityWidth) Writes the contents of the city to a human readable text filevoid
Writes the contents of the city to a human readable text file
-
Constructor Details
-
BuildingGenerator
-
-
Method Details
-
getPathGenerator
Returns the PathGenerator instance.- Returns:
- PathGenerator instance
-
getWallBuffer
public int getWallBuffer()Returns the number of tiles buildings are placed from the wall.- Returns:
- wall buffer amount
-
getRightWallBuffer
public int getRightWallBuffer()Returns the number of tiles buildings are placed from the right wall.- Returns:
- right wall buffer amount
-
getCityBuffer
public int getCityBuffer()Returns the number of tiles buildings are placed from each other.- Returns:
- buidling buffer amount
-
getRowBuffer
public int getRowBuffer()Returns the number of tiles buildings are placed from each other on the y axis.- Returns:
- buidling buffer amount
-
getCityHeight
public int getCityHeight()Gets the city height.- Returns:
- city height
-
getCityWidth
public int getCityWidth()Gets the city width.- Returns:
- city width
-
getBuildings
Returns a copy of this BuildingGenerator's buildingspec list- Returns:
- List of BuildingSpecifications
-
writeCity
public void writeCity(int cityHeight, int cityWidth) Writes the contents of the city to a human readable text file- Parameters:
cityHeight
- height of the city in tilescityWidth
- width of the city in tiles
-
writeCity
Writes the contents of the city to a human readable text file- Parameters:
cityHeight
- height of the city in tilescityWidth
- width of the city in tilespath
- path to output file
-
getCharMap
public char[][] getCharMap()Returns char char array of the current city contents in the CityRows- Returns:
- 2d char array denoting the current position of each building
-
getCityRows
Returns a copy of this BuildingGenerators CityRow list - used to find building placements- Returns:
- List of CityRows, each containing buildings with appropriate placements
-
resetBuildings
public void resetBuildings()
-