Class DelayedStructureSpecificationInputRequest.Factory

java.lang.Object
nl.pim16aap2.animatedarchitecture.core.util.delayedinput.DelayedStructureSpecificationInputRequest.Factory
Enclosing class:
DelayedStructureSpecificationInputRequest

public static final class DelayedStructureSpecificationInputRequest.Factory extends Object
  • Constructor Details

  • Method Details

    • get

      public CompletableFuture<Optional<Structure>> get(Duration timeout, List<Structure> options, IPlayer player)
      Requests the user to specify which structure they want to use out of a list of multiple.
      Parameters:
      timeout - The time to wait for the user to specify a structure.
      options - The list of structures to choose from.
      player - The player to request the structure from.
      Returns:
      A CompletableFuture that will be completed with the structure the user specified. If the user did not specify a structure in time, the future will be completed with Optional.empty().

      If the list of options is empty, the future will be completed with Optional.empty() and no request will be sent to the user.

      If the list of options contains only one element, the future will be completed with that element and no request will be sent to the user.

    • get

      public CompletableFuture<Optional<Structure>> get(List<Structure> options, IPlayer player)
      Requests the user to specify which structure they want to use out of a list of multiple.

      Uses IConfig.specificationTimeout() for the timeout.

      Parameters:
      options - The list of structures to choose from.
      player - The player to request the structure from.
      Returns:
      A CompletableFuture that will be completed with the structure the user specified. If the user did not specify a structure in time, the future will be completed with Optional.empty().

      If the list of options is empty, the future will be completed with Optional.empty() and no request will be sent to the user.

      If the list of options contains only one element, the future will be completed with that element and no request will be sent to the user.