Class Robot

java.lang.Object
   |
   +----Robot

public class Robot
extends Object
implements Runnable
A Robot is a self-animating object that moves (or tries to move) when you switch it on.


Variable Index

 o myStepper
 o on

Constructor Index

 o Robot(Stepper, Color)

Method Index

 o act()
This method is called periodically by run() if the robot is on.
 o run()
run() has a while(true) whose body calls act() if the robot is on, and does nothing otherwise.
 o switchOff()
switchOff() turns the robot off
 o switchOn()
switchOn() turns the robot on

Variables

 o myStepper
 protected Stepper myStepper
 o on
 protected boolean on

Constructors

 o Robot
 public Robot(Stepper s,
              Color c)

Methods

 o switchOn
 public void switchOn()
switchOn() turns the robot on

 o switchOff
 public void switchOff()
switchOff() turns the robot off

 o run
 public void run()
run() has a while(true) whose body calls act() if the robot is on, and does nothing otherwise.

 o act
 public void act()
This method is called periodically by run() if the robot is on.