Class DelayedStructureSpecificationInputRequest.Factory
java.lang.Object
nl.pim16aap2.animatedarchitecture.core.util.delayedinput.DelayedStructureSpecificationInputRequest.Factory
- Enclosing class:
DelayedStructureSpecificationInputRequest
-
Constructor Summary
ConstructorsConstructorDescriptionFactory(IExecutor executor, IConfig config, StructureSpecificationManager structureSpecificationManager) -
Method Summary
Modifier and TypeMethodDescriptionRequests the user to specify which structure they want to use out of a list of multiple.Requests the user to specify which structure they want to use out of a list of multiple.
-
Constructor Details
-
Factory
@Inject public Factory(IExecutor executor, IConfig config, StructureSpecificationManager structureSpecificationManager)
-
-
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
CompletableFuturethat will be completed with the structure the user specified. If the user did not specify a structure in time, the future will be completed withOptional.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
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
CompletableFuturethat will be completed with the structure the user specified. If the user did not specify a structure in time, the future will be completed withOptional.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.
-