Class BuildingGenerator

java.lang.Object
com.deco2800.game.areas.MapGenerator.Buildings.BuildingGenerator

public class BuildingGenerator extends Object
  • Constructor Details

    • BuildingGenerator

      public BuildingGenerator(MapGenerator mg)
  • Method Details

    • getPathGenerator

      public PathGenerator 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

      public List<BuildingSpecification> 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 tiles
      cityWidth - width of the city in tiles
    • writeCity

      public void writeCity(int cityHeight, int cityWidth, String path)
      Writes the contents of the city to a human readable text file
      Parameters:
      cityHeight - height of the city in tiles
      cityWidth - width of the city in tiles
      path - 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

      public List<CityRow> 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()