Package com.deco2800.game.areas.terrain
Class TerrainFactory
java.lang.Object
com.deco2800.game.areas.terrain.TerrainFactory
public class TerrainFactory
extends java.lang.Object
Factory for creating game terrains.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TerrainFactory.TerrainType
This enum should contain the different terrains in your game, e.g. -
Constructor Summary
Constructors Constructor Description TerrainFactory(CameraComponent cameraComponent)
Create a terrain factory with Orthogonal orientationTerrainFactory(CameraComponent cameraComponent, TerrainComponent.TerrainOrientation orientation)
Create a terrain factory -
Method Summary
Modifier and Type Method Description TerrainComponent
createTerrain(TerrainFactory.TerrainType terrainType)
Create a terrain of the given type, using the orientation of the factory.TerrainComponent
createTerrainRandomly(TerrainFactory.TerrainType terrainType, int xValue)
GridPoint2
getMapSize()
-
Constructor Details
-
TerrainFactory
Create a terrain factory with Orthogonal orientation- Parameters:
cameraComponent
- Camera to render terrains to. Must be ortographic.
-
TerrainFactory
public TerrainFactory(CameraComponent cameraComponent, TerrainComponent.TerrainOrientation orientation)Create a terrain factory- Parameters:
cameraComponent
- Camera to render terrains to. Must be orthographic.orientation
- orientation to render terrain at
-
-
Method Details
-
getMapSize
-
createTerrain
Create a terrain of the given type, using the orientation of the factory. This can be extended to add additional game terrains.- Parameters:
terrainType
- Terrain to create- Returns:
- Terrain component which renders the terrain
-
createTerrainRandomly
-