Class ListArgumentNode
java.lang.Object
me.efekos.simpler.commands.node.CommandNode
me.efekos.simpler.commands.node.ArgumentNode
me.efekos.simpler.commands.node.impl.ListArgumentNode
- Direct Known Subclasses:
EnumArgumentNode
An example of custom
ArgumentNode
s. Allows player to choose an argument from the list given.-
Constructor Summary
ConstructorDescriptionListArgumentNode
(String... list) Creates a new node.ListArgumentNode
(List<String> list, CommandNode... children) Creates a new node. -
Method Summary
Methods inherited from class me.efekos.simpler.commands.node.CommandNode
addChild, addChild, getChildren, getConsoleExecutive, getDescription, getExecutive, getParent, getPermission, setConsoleExecutive, setDescription, setExecutive, setParent, setPermission
-
Constructor Details
-
ListArgumentNode
Creates a new node.- Parameters:
list
- Values that this argument can have.
-
ListArgumentNode
Creates a new node.- Parameters:
list
- List of the values that this argument can have.children
- Any child node to add to this node if you would like to. You can useCommandNode.addChild(CommandNode)
later.
-
-
Method Details
-
isCorrect
Checks for a given argument and ensures that the argument is correct.- Specified by:
isCorrect
in classArgumentNode
- Parameters:
given
- Argument that was given for this node.- Returns:
- Whether the argument is correct or not.
-
suggest
Provides a list that can be added to the final list of tab completion.- Specified by:
suggest
in classCommandNode
- Parameters:
sender
- Sender that needs a tab completion. Probably aPlayer
since console doesn't need a tab completion.args
- List of the other arguments given by the sender.- Returns:
- A list for tab completion.
-