Class ActionBuilder
-
- All Implemented Interfaces:
public final class ActionBuilderBuilds up movements for an Action.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classActionBuilder.RotationDSL to define a RotationMovement in an action.
public final classActionBuilder.LinearDSL to define a LinearMovement in an action.
-
Field Summary
Fields Modifier and Type Field Description private ActionSpeedrequestedSpeed
-
Constructor Summary
Constructors Constructor Description ActionBuilder()
-
Method Summary
Modifier and Type Method Description final ActionSpeedgetRequestedSpeed()How "fast" this action runs: e.g. final UnitsetRequestedSpeed(ActionSpeed requestedSpeed)How "fast" this action runs: e.g. final Unitrotate(Rotator $self, Function1<ActionBuilder.Rotation, Unit> r)DSL to rotate a Rotator to an angle with a stop-check final Unitrotate(Rotator $self, Integer angle)DSL to rotate a Rotator to a specific angle. final UnitforwardUntil(Rotator $self, Function0<Boolean> forwardCheck)DSL to rotate a Rotator in a "positive" direction with the given check used as a stop-check. final UnitbackwardUntil(Rotator $self, Function0<Boolean> backwardCheck)DSL to rotate a Rotator in a "negative" direction until a stop check is true. final Unitextend(LinearActuator $self, Function1<ActionBuilder.Linear, Unit> m)DSL to move a LinearActuator to a specific position with a stop check. final UnitgoTo(LinearActuator $self, Integer position)DSL to move a LinearActuator to a specific position without a stop check. final Unitexecute(Function0<Boolean> function)DSL to execute a code block as a movement. final <Error class: unknown class>plus(ActionBuilder otherBuilder)Create a new ActionBuilder with the movements from this one plus the other. final UnitplusAssign(ActionBuilder otherBuilder)Add another builder's movements to this. -
-
Method Detail
-
getRequestedSpeed
final ActionSpeed getRequestedSpeed()
How "fast" this action runs: e.g. each "step" takes this amount of time at a minimum.
-
setRequestedSpeed
final Unit setRequestedSpeed(ActionSpeed requestedSpeed)
How "fast" this action runs: e.g. each "step" takes this amount of time at a minimum.
-
rotate
final Unit rotate(Rotator $self, Function1<ActionBuilder.Rotation, Unit> r)
DSL to rotate a Rotator to an angle with a stop-check
-
forwardUntil
final Unit forwardUntil(Rotator $self, Function0<Boolean> forwardCheck)
DSL to rotate a Rotator in a "positive" direction with the given check used as a stop-check.
-
backwardUntil
final Unit backwardUntil(Rotator $self, Function0<Boolean> backwardCheck)
DSL to rotate a Rotator in a "negative" direction until a stop check is true.
-
extend
final Unit extend(LinearActuator $self, Function1<ActionBuilder.Linear, Unit> m)
DSL to move a LinearActuator to a specific position with a stop check.
-
goTo
final Unit goTo(LinearActuator $self, Integer position)
DSL to move a LinearActuator to a specific position without a stop check.
-
execute
final Unit execute(Function0<Boolean> function)
DSL to execute a code block as a movement. The function must return
trueif the code was "completed" (e.g. this is a "naked" stop check).
-
plus
final <Error class: unknown class> plus(ActionBuilder otherBuilder)
Create a new ActionBuilder with the movements from this one plus the other.
-
plusAssign
final Unit plusAssign(ActionBuilder otherBuilder)
Add another builder's movements to this.
-
-
-
-