Class ArgumentSection
java.lang.Object
io.github.syst3ms.skriptparser.lang.Statement
io.github.syst3ms.skriptparser.lang.CodeSection
io.github.syst3ms.skriptparser.lang.lambda.ArgumentSection
- All Implemented Interfaces:
Finishing, SyntaxElement
- Direct Known Subclasses:
ReturnSection, SecLoop
A
CodeSection that can hold information about arguments.-
Field Summary
Fields inherited from class CodeSection
first, items, last -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfinish()By convention, this method should be fired in one of the following occasions: The execution of the section is completely done and the (actual) next element is referenced to be walked on. This method is completely stopped by any means whatsoever. An example of this second occasion isEffContinuecontinuing over multiple loops.Object[]voidsetArguments(Object... arguments) Sets the arguments that should be passed to the section code.start()This function is called from the section containing the code, and returns an Optional describing the firstStatementthat should be run in the consumer.voidAfter execution has stopped, because a statement has forcefully ended the execution, this consumer is fed with the lastStatementthat has been processed on the next iteration.Methods inherited from class CodeSection
checkFinishing, checkFinishing, checkReturns, getAllowedSyntaxes, getFirst, getItems, getLast, isRestrictingExpressions, loadSection, run, setItems, walkMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface SyntaxElement
init, toString
-
Constructor Details
-
ArgumentSection
public ArgumentSection()
-
-
Method Details
-
start
This function is called from the section containing the code, and returns an Optional describing the firstStatementthat should be run in the consumer.
By default, returnsCodeSection.getFirst(). -
step
After execution has stopped, because a statement has forcefully ended the execution, this consumer is fed with the lastStatementthat has been processed on the next iteration.
Note that this function only needs to be called for iterative sections, like loops and maps, that need to execute certain actions after each iteration, instead of only when the execution has finished (see finish() for that)
By default, does nothing.- Parameters:
item- the last statement- See Also:
-
finish
public void finish()Description copied from interface:FinishingBy convention, this method should be fired in one of the following occasions:- The execution of the section is completely done and the (actual) next element is referenced to be walked on.
- This method is completely stopped by any means whatsoever.
EffContinuecontinuing over multiple loops. If that effect continues 3 loops in one go, this means that the 2 most inner-loops need to be completely reset, since they have the possibility to be looped over again. EffContinue therefore calls this method on those loops.
Another example isEffExit, which finishes every section that implements this interface, because of the same reasons specified above. -
getArguments
- Returns:
- the arguments passed to this section's code
-
setArguments
Sets the arguments that should be passed to the section code.- Parameters:
arguments- this section's arguments
-