Package com.csse3200.game.services
Class MapService
java.lang.Object
com.csse3200.game.services.MapService
Provides services related to map functionalities such as tiles and lanes in genral.
-
Constructor Summary
ConstructorDescriptionMapService
(CameraComponent camera) Constructs a new MapService instance based on the provided camera.MapService
(Entity entity, TerrainFactory terrainFactory) Constructs a new MapService instance using the given entity and terrain factory. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the terrain component from the entity.Returns the associated entity.int
Returns the height of the Grid.int
getWidth()
Returns the width of the Grid.
-
Constructor Details
-
MapService
Constructs a new MapService instance based on the provided camera.- Parameters:
camera
- The camera component used for the terrain creation.
-
MapService
Constructs a new MapService instance using the given entity and terrain factory.- Parameters:
entity
- The entity associated with this service.terrainFactory
- The terrain factory used for creating terrains.
-
-
Method Details
-
getEntity
Returns the associated entity.- Returns:
- The entity related to this map service.
-
getComponent
Retrieves the terrain component from the entity.- Returns:
- The terrain component of the associated entity.
-
getHeight
public int getHeight()Returns the height of the Grid.- Returns:
- Height of the Grid.
-
getWidth
public int getWidth()Returns the width of the Grid.- Returns:
- Width of the Grid.
-