Created
December 20, 2014 14:23
-
-
Save Limeth/684852a72d53090604a7 to your computer and use it in GitHub Desktop.
Command parameter completion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We have two options for implementing the command parameter suggestion: | |
A) | |
The CommandParameterAdapter (https://github.com/Limeth/Terasology/blob/develop/engine/src/main/java/org/terasology/logic/console/internal/adapter/CommandParameterAdapter.java) would have a method returning all possible cases, while a CommandParam would accept a Predicate-like object filtering those cases. The filtered cases would then be suggested after being composed to Strings by the corresponding CommandParameterAdapter. | |
B) | |
The CommandParam would accept a 'suggestion' parameter of a class implementing an interface with a return type of Object[] or Collection<Object>. The returned values would then be suggested after being composed to Strings by the corresponding CommandParameterAdapter. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment