Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Simple As That (http://www.chiefdelphi.com/forums/showthread.php?t=103641)

mwtidd 22-02-2012 20:24

Simple As That
 
See below

mwtidd 22-02-2012 20:26

Re: Simple As That
 
Code:

public class AutoAim extends NeverEndingCommand{
   
    public String currentCommand = new FaceNorthAimCenter().getName();

    protected void initialize() {
    }

    protected void execute() {
        if(Bob.dt.isFacingEast() &&
                ! currentCommand.equalsIgnoreCase(new FaceEast().getName())){
            currentCommand = new FaceEast().getName();
            new FaceEast().start();
        }else if (Bob.dt.isFacingWest() &&
                !currentCommand.equalsIgnoreCase(new FaceWest().getName())){
            currentCommand = new FaceWest().getName();
            new FaceWest().start();
        }else if(!currentCommand.equalsIgnoreCase(new FaceNorthAimCenter().getName())){
            currentCommand = new FaceNorthAimCenter().getName();
            new FaceNorthAimCenter().start();
        }else{
            //do nothing, the right command is alreay executing
        }
    }
   
}



All times are GMT -5. The time now is 09:53.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi