Class ActionBuilder
-
- All Implemented Interfaces:
public final class ActionBuilder
Builds up movements for an Action.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
ActionBuilder.Rotation
DSL to define a RotationMovement in an action.
public final class
ActionBuilder.Linear
DSL to define a LinearMovement in an action.
-
Field Summary
Fields Modifier and Type Field Description private ActionSpeed
requestedSpeed
-
Constructor Summary
Constructors Constructor Description ActionBuilder()
-
Method Summary
Modifier and Type Method Description final ActionSpeed
getRequestedSpeed()
How "fast" this action runs: e.g. final Unit
setRequestedSpeed(ActionSpeed requestedSpeed)
How "fast" this action runs: e.g. final Unit
rotate(Rotator $self, Function1<ActionBuilder.Rotation, Unit> r)
DSL to rotate a Rotator to an angle with a stop-check final Unit
rotate(Rotator $self, Integer angle)
DSL to rotate a Rotator to a specific angle. 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. final Unit
backwardUntil(Rotator $self, Function0<Boolean> backwardCheck)
DSL to rotate a Rotator in a "negative" direction until a stop check is true. final Unit
extend(LinearActuator $self, Function1<ActionBuilder.Linear, Unit> m)
DSL to move a LinearActuator to a specific position with a stop check. final Unit
goTo(LinearActuator $self, Integer position)
DSL to move a LinearActuator to a specific position without a stop check. final Unit
execute(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 Unit
plusAssign(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
true
if 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.
-
-
-
-