Class MapService

java.lang.Object
com.csse3200.game.services.MapService

public class MapService extends Object
Provides services related to map functionalities such as tiles and lanes in genral.
  • Constructor Details

    • MapService

      public MapService(CameraComponent camera)
      Constructs a new MapService instance based on the provided camera.
      Parameters:
      camera - The camera component used for the terrain creation.
    • MapService

      public MapService(Entity entity, TerrainFactory terrainFactory)
      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

      public Entity getEntity()
      Returns the associated entity.
      Returns:
      The entity related to this map service.
    • getComponent

      public TerrainComponent 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.