Class ArgumentNode

java.lang.Object
me.efekos.simpler.commands.node.CommandNode
me.efekos.simpler.commands.node.ArgumentNode
Direct Known Subclasses:
DoubleArgumentNode, IntegerArgumentNode, ListArgumentNode, PlayerArgumentNode, StringArgumentNode

public abstract class ArgumentNode extends CommandNode
Main that is used for making argument nodes. It is highly recommended to extend this class instead of CommandNode if your node is an argument. Because this is the only type that Simpler understands about argument nodes.
  • Constructor Details

    • ArgumentNode

      public ArgumentNode(CommandNode... children)
      Created a new ArgumentNode to be used in CommandTrees.
      Parameters:
      children - Children of this node if you would like to add any.
  • Method Details

    • isCorrect

      public abstract boolean isCorrect(String given)
      Checks for a given argument and ensures that the argument is correct.
      Parameters:
      given - Argument that was given for this node.
      Returns:
      Whether the argument is correct or not.