home *** CD-ROM | disk | FTP | other *** search
- class VRCAsyncRobot extends Thread {
- VRCRobot VRCRobo;
- private boolean kill = false;
- private String sCommand = new String();
- private int repeat = 1;
-
- VRCAsyncRobot(VRCRobot var1) {
- this.VRCRobo = var1;
- ((Thread)this).start();
- }
-
- public void run() {
- while(!this.kill) {
- if (this.sCommand.equals("walk")) {
- System.out.println("Walking");
-
- for(int var7 = 0; var7 < this.repeat; ++var7) {
- this.VRCRobo.walk();
- }
-
- this.sCommand = "";
- this.suicide();
- } else if (this.sCommand.equals("animate")) {
- for(int var6 = 0; var6 < this.repeat; ++var6) {
- this.VRCRobo.animate();
- }
-
- this.sCommand = "";
- this.suicide();
- } else if (this.sCommand.equals("rwave")) {
- for(int var5 = 0; var5 < this.repeat; ++var5) {
- this.VRCRobo.wave("right");
- }
-
- this.sCommand = "";
- this.suicide();
- } else if (this.sCommand.equals("lwave")) {
- for(int var4 = 0; var4 < this.repeat; ++var4) {
- this.VRCRobo.wave("left");
- }
-
- this.sCommand = "";
- this.suicide();
- } else if (this.sCommand.equals("lleg")) {
- for(int var3 = 0; var3 < this.repeat; ++var3) {
- this.VRCRobo.liftLeg("left");
- }
-
- this.sCommand = "";
- this.suicide();
- } else if (this.sCommand.equals("rleg")) {
- for(int var2 = 0; var2 < this.repeat; ++var2) {
- this.VRCRobo.liftLeg("right");
- }
-
- this.sCommand = "";
- this.suicide();
- } else if (this.sCommand.equals("color")) {
- for(int var1 = 0; var1 < this.repeat; ++var1) {
- this.VRCRobo.colorRainbo();
- }
-
- this.sCommand = "";
- this.suicide();
- }
- }
-
- }
-
- public void destroy() {
- this.repeat = 0;
- this.kill = true;
- ((Thread)this).stop();
- }
-
- public void sendCommand(String var1) {
- this.sCommand = var1;
- }
-
- public void suicide() {
- this.kill = true;
- ((Thread)this).stop();
- }
-
- public void repeat(int var1) {
- this.repeat = var1;
- }
- }
-