Class ScriptCommand

java.lang.Object
com.blackrook.rookscript.lang.ScriptCommand

public final class ScriptCommand extends Object
Single script directive.
Author:
Matthew Tropiano
  • Method Details

    • create

      public static ScriptCommand create(ScriptCommandType type)
      Creates a new script directive.
      Parameters:
      type - the directive type.
      Returns:
      a new script directive.
    • create

      public static ScriptCommand create(ScriptCommandType type, boolean operand)
      Creates a new script directive.
      Parameters:
      type - the directive type.
      operand - the operand.
      Returns:
      a new script directive.
    • create

      public static ScriptCommand create(ScriptCommandType type, long operand)
      Creates a new script directive.
      Parameters:
      type - the directive type.
      operand - the operand.
      Returns:
      a new script directive.
    • create

      public static ScriptCommand create(ScriptCommandType type, double operand)
      Creates a new script directive.
      Parameters:
      type - the directive type.
      operand - the operand.
      Returns:
      a new script directive.
    • create

      public static ScriptCommand create(ScriptCommandType type, String operand)
      Creates a new script directive.
      Parameters:
      type - the directive type.
      operand - the only operand.
      Returns:
      a new script directive.
    • create

      public static ScriptCommand create(ScriptCommandType type, Object operand)
      Creates a new script directive.
      Parameters:
      type - the directive type.
      operand - the only operand.
      Returns:
      a new script directive.
    • create

      public static ScriptCommand create(ScriptCommandType type, String operand1, boolean operand2)
      Creates a new script directive.
      Parameters:
      type - the directive type.
      operand1 - the first operand.
      operand2 - the second operand.
      Returns:
      a new script directive.
    • create

      public static ScriptCommand create(ScriptCommandType type, Integer operand1, boolean operand2)
      Creates a new script directive.
      Parameters:
      type - the directive type.
      operand1 - the first operand.
      operand2 - the second operand.
      Returns:
      a new script directive.
    • create

      public static ScriptCommand create(ScriptCommandType type, Long operand1, boolean operand2)
      Creates a new script directive.
      Parameters:
      type - the directive type.
      operand1 - the first operand.
      operand2 - the second operand.
      Returns:
      a new script directive.
    • create

      public static ScriptCommand create(ScriptCommandType type, String operand1, long operand2)
      Creates a new script directive.
      Parameters:
      type - the directive type.
      operand1 - the first operand.
      operand2 - the second operand.
      Returns:
      a new script directive.
    • create

      public static ScriptCommand create(ScriptCommandType type, String operand1, double operand2)
      Creates a new script directive.
      Parameters:
      type - the directive type.
      operand1 - the first operand.
      operand2 - the second operand.
      Returns:
      a new script directive.
    • create

      public static ScriptCommand create(ScriptCommandType type, String operand1, String operand2)
      Creates a new script directive.
      Parameters:
      type - the directive type.
      operand1 - the first operand.
      operand2 - the second operand.
      Returns:
      a new script directive.
    • create

      public static ScriptCommand create(ScriptCommandType type, String operand1, Object operand2)
      Creates a new script directive.
      Parameters:
      type - the directive type.
      operand1 - the first operand.
      operand2 - the second operand.
      Returns:
      a new script directive.
    • getType

      public ScriptCommandType getType()
    • getOperand1

      public Object getOperand1()
    • getOperand2

      public Object getOperand2()
    • execute

      public boolean execute(ScriptInstance scriptInstance)
      Executes this command.
      Parameters:
      scriptInstance - the originating script instance.
      Returns:
      if false, stop script running, else if true, continue.
    • toString

      public String toString()
      Overrides:
      toString in class Object