Class Statement
java.lang.Object
io.github.syst3ms.skriptparser.lang.Statement
- All Implemented Interfaces:
SyntaxElement
- Direct Known Subclasses:
CodeSection, Effect
The base class for any runnable line of code inside of a script.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetNext()Optional<? extends CodeSection> abstract booleanrun(TriggerContext ctx) Executes this Statementstatic booleanrunAll(Statement start, TriggerContext context) Runs all code starting at a given point sequentiallySets the Statement that is placed after this Statement in the file.setParent(CodeSection section) Sets the parentCodeSectionof this Statementwalk(TriggerContext ctx) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface SyntaxElement
init, toString
-
Field Details
-
parent
-
next
-
-
Constructor Details
-
Statement
public Statement()
-
-
Method Details
-
run
-
getParent
- Returns:
- the parent of this Statement
-
setParent
Sets the parentCodeSectionof this Statement- Parameters:
section- the parent- Returns:
- this Statement
-
getNext
-
setNext
Sets the Statement that is placed after this Statement in the file. You can assume that the next statement of thenextparameter is known if it has such a statement.- Parameters:
next- the Statement that is following this one- Returns:
- this statement
-
walk
By default, runsrun(TriggerContext); returnsgetNext()if it returns true, ornullotherwise. Note that if this method is overridden, then the implementation of run(TriggerContext) doesn't matter.- Parameters:
ctx- the event- Returns:
- the next item to be ran, or
nullif this is the last item to be executed
-
runAll
Runs all code starting at a given point sequentially- Parameters:
start- the Statement the method should first runcontext- the context- Returns:
trueif the code ran normally, andfalseif any exception occurred
-