public class RMRobotAction extends RMAction
Modifier and Type | Class and Description |
---|---|
static class |
RMRobotAction.Forward
An op class for moving a shape forward along the path of its current roll.
|
static class |
RMRobotAction.MoveTo
An op class for shape location change.
|
static class |
RMRobotAction.RobotOp
A class representing an operation to an actor shape, like Forward, Backward, TurnRight, TurnLeft, etc.
|
static class |
RMRobotAction.Turn
An op class for turning a shape by a given number of degrees.
|
Constructor and Description |
---|
RMRobotAction() |
Modifier and Type | Method and Description |
---|---|
void |
addOp(RMRobotAction.RobotOp anOp)
Adds a new operation.
|
void |
addOp(RMRobotAction.RobotOp anOp,
int anIndex)
Adds a new operation at the given index.
|
void |
forward(float anAmount)
Adds a Forward instruction to cpu.
|
float |
getMoveSpeed()
Returns the move speed in points per second.
|
RMRobotAction.RobotOp |
getOp(int anIndex)
Returns the individual operation at given index.
|
int |
getOpCount()
Returns the number of painter shape operations.
|
float |
getTurnSpeed()
Returns the turn speed in degrees per second.
|
void |
moveTo(float anX,
float aY)
Adds a MoveTo instruction to cpu.
|
RMRobotAction.RobotOp |
removeOp(int anIndex)
Removes the operation at given index.
|
int |
removeOp(RMRobotAction.RobotOp anOp)
Removes this given operation.
|
void |
setShape(RMShape aShape)
Override to get initial location, roll.
|
void |
setTime(double aTime)
Sets the time.
|
void |
turn(float anAngle)
Adds a Turn instruction to cpu.
|
public void setShape(RMShape aShape)
public float getMoveSpeed()
public float getTurnSpeed()
public int getOpCount()
public RMRobotAction.RobotOp getOp(int anIndex)
public void addOp(RMRobotAction.RobotOp anOp)
public void addOp(RMRobotAction.RobotOp anOp, int anIndex)
public RMRobotAction.RobotOp removeOp(int anIndex)
public int removeOp(RMRobotAction.RobotOp anOp)
public void moveTo(float anX, float aY)
public void forward(float anAmount)
public void turn(float anAngle)