CoroutineCommandBuilder

class CoroutineCommandBuilder : Command

Builds a CoroutineCommand, in the same fluent style as com.pedropathing.ivy.CommandBuilder.

The builder is itself a com.pedropathing.ivy.Command, so it can be scheduled or composed with the usual Ivy operators without calling build:

coroutineCommand {
await(arm.toHigh())
wait(0.5)
fork(claw.open())
}.requiring(arm).setPriority(1).schedule()

A fresh CoroutineCommand is created from the current configuration every time the builder is started, so one builder can be scheduled repeatedly.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open override fun blockedBehavior(): BlockedBehavior
Link copied to clipboard

Creates a CoroutineCommand from the current configuration. Later changes to the builder do not affect commands it has already built.

Link copied to clipboard
open fun cancel()
Link copied to clipboard
open override fun conflictBehavior(): ConflictBehavior
Link copied to clipboard
open override fun done(): Boolean
Link copied to clipboard
open override fun end(endCondition: EndCondition)
Link copied to clipboard
open override fun execute()
Link copied to clipboard
open override fun interruptedBehavior(): InterruptedBehavior
Link copied to clipboard
open override fun priority(): Int
Link copied to clipboard
open fun proxy(): CommandBuilder?
Link copied to clipboard
open fun raceWith(vararg commands: Command?): CommandBuilder?
Link copied to clipboard
open override fun requirements(): Set<Any>
Link copied to clipboard
fun requiring(vararg requirements: Any): CoroutineCommandBuilder

Sets the requirements of the command.

Link copied to clipboard
open fun schedule()
Link copied to clipboard
fun setBlockedBehavior(blockedBehavior: BlockedBehavior): CoroutineCommandBuilder

Sets what the command does when blocked by a command with a higher priority.

Link copied to clipboard

Sets the body of the command. See CommandScope for what it can suspend on.

Link copied to clipboard
fun setConflictBehavior(conflictBehavior: ConflictBehavior): CoroutineCommandBuilder

Sets what the command does when a conflicting command with an equal priority is running.

Link copied to clipboard
fun setInterruptedBehavior(interruptedBehavior: InterruptedBehavior): CoroutineCommandBuilder

Sets what the command does when interrupted.

Link copied to clipboard

Sets the priority the command has over commands with conflicting requirements.

Link copied to clipboard
open override fun start()
Link copied to clipboard
open fun then(vararg commands: Command?): CommandBuilder?
Link copied to clipboard
open fun unless(condition: BooleanSupplier?): CommandBuilder?
Link copied to clipboard
open fun until(condition: BooleanSupplier?): CommandBuilder?
Link copied to clipboard
open fun with(vararg commands: Command?): CommandBuilder?