Class InteractableService

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

public class InteractableService extends Object
Class to register interactable objects to and to call when the player attempts to interact with them. Uses a system to determine which object to interact with based upon the player's proximity to the object and the type it is. i.e. a station will have more weight than a bench for instance
  • Constructor Details

    • InteractableService

      public InteractableService()
  • Method Details

    • registerEntity

      public void registerEntity(Entity entity)
      Register an interactable enitity to the service
      Parameters:
      entity - - the entity to register
    • unregisterEntity

      public void unregisterEntity(Entity entity)
      Remove the entity from the interactables map
      Parameters:
      entity - to be removed
    • clearEntities

      public void clearEntities()
      Clear all entities from the interactables map
    • getInteractables

      public Map<Entity,com.badlogic.gdx.math.Vector2> getInteractables()
      Get the interactables map which returns an Entity and its position as entries in a mao
      Returns:
      the interactables map