Package com.csse3200.game.areas.terrain
Class TerrainChunk
java.lang.Object
com.csse3200.game.areas.terrain.TerrainChunk
A chunk of terrain in the game world.
This class is responsible for generating and rendering the terrain.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.getTileTypeCount
(String tileType) Get the tile type count for a given tile type.
-
Field Details
-
CHUNK_SIZE
public static final int CHUNK_SIZE- See Also:
-
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 worldloadedChunks
- The chunks of terrain that are currently loadedterrainResource
- The terrain resource to use for generating the terrain
-
getTileTypeCount
-
getTileTypeCount
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
-