Class TerrainChunk

java.lang.Object
com.csse3200.game.areas.terrain.TerrainChunk

public class TerrainChunk extends Object
A chunk of terrain in the game world. This class is responsible for generating and rendering the terrain.
  • Field Details

    • CHUNK_SIZE

      public static final int CHUNK_SIZE
      See Also:
    • grid

      public com.badlogic.gdx.utils.Array<BitSet> grid
  • Method Details

    • generateTiles

      public void generateTiles(com.badlogic.gdx.math.GridPoint2 chunkPos, Map<com.badlogic.gdx.math.GridPoint2,TerrainChunk> loadedChunks, TerrainResource terrainResource)
      Generate the tiles for this chunk of terrain.
      Parameters:
      chunkPos - The position of this chunk in the world
      loadedChunks - The chunks of terrain that are currently loaded
      terrainResource - The terrain resource to use for generating the terrain
    • getTileTypeCount

      public Map<String,Integer> getTileTypeCount()
    • getTileTypeCount

      public Integer getTileTypeCount(String tileType)
      Get the tile type count for a given tile type. Returns null if the tile type does not exist.
      Parameters:
      tileType - The tile type to get the count for
      Returns:
      The count of the tile type