Package com.csse3200.game.services
Class InteractableService
java.lang.Object
com.csse3200.game.services.InteractableService
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clear all entities from the interactables mapGet the interactables map which returns an Entity and its position as entries in a maovoid
registerEntity
(Entity entity) Register an interactable enitity to the servicevoid
unregisterEntity
(Entity entity) Remove the entity from the interactables map
-
Constructor Details
-
InteractableService
public InteractableService()
-
-
Method Details
-
registerEntity
Register an interactable enitity to the service- Parameters:
entity
- - the entity to register
-
unregisterEntity
Remove the entity from the interactables map- Parameters:
entity
- to be removed
-
clearEntities
public void clearEntities()Clear all entities from the interactables map -
getInteractables
Get the interactables map which returns an Entity and its position as entries in a mao- Returns:
- the interactables map
-