Class StructureSpecificationManager

java.lang.Object
nl.pim16aap2.animatedarchitecture.core.api.restartable.Restartable
nl.pim16aap2.animatedarchitecture.core.managers.StructureSpecificationManager
All Implemented Interfaces:
IRestartable

@Singleton public final class StructureSpecificationManager extends Restartable
Represents a manager for handling structure specifications requests.
  • Constructor Details

    • StructureSpecificationManager

      @Inject public StructureSpecificationManager(RestartableHolder holder)
  • Method Details

    • isActive

      public boolean isActive(IPlayer player)
      Checks if there is an open structure specification request for a player.
      Parameters:
      player - The player to check.
      Returns:
      True if there is an open structure specification request for the player.
    • placeRequest

      public void placeRequest(IPlayer player, DelayedInputRequest<String> request)
      Registers a new delayed input request for the given player.

      If a request is already active for the given player, the old request will be cancelled and replaced by the new one.

      Parameters:
      player - The player to request.
      request - The request.
    • handleInput

      public boolean handleInput(IPlayer player, String input)
      Handles input for a player.
      Parameters:
      player - The player that provided input.
      input - The input to handle.
      Returns:
      False if no request could be found for the player.
    • cancelRequest

      public boolean cancelRequest(IPlayer player)
      Cancels an active request for a player.
      Parameters:
      player - The player whose requests to cancel.
      Returns:
      True if a request was cancelled.
    • shutDown

      public void shutDown()
      Description copied from interface: IRestartable
      Handles a shutdown.