CoroutineCommand
class CoroutineCommand(requirements: Set<Any> = emptySet(), priority: Int = 0, interruptedBehavior: InterruptedBehavior = InterruptedBehavior.END, conflictBehavior: ConflictBehavior = ConflictBehavior.OVERRIDE, blockedBehavior: BlockedBehavior = BlockedBehavior.CANCEL, body: suspend CommandScope.() -> Unit) : Command
A Command whose behavior is written as a sequential coroutine instead of as a start/execute/done state machine.
The body is advanced one slice per execute call and the command is done once the body returns. Interrupting the command resumes the body with a CancellationException, so finally blocks run and inline commands started with CommandScope.await are ended.
Constructors
Link copied to clipboard
constructor(requirements: Set<Any> = emptySet(), priority: Int = 0, interruptedBehavior: InterruptedBehavior = InterruptedBehavior.END, conflictBehavior: ConflictBehavior = ConflictBehavior.OVERRIDE, blockedBehavior: BlockedBehavior = BlockedBehavior.CANCEL, body: suspend CommandScope.() -> Unit)