Go to Post Mistakes happen. It's how we react to them and what we learn from them that shows what type of people we are. - Daniel_LaFleur [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Spotlight this post!  
Unread 02-22-2012, 08:26 PM
mwtidd's Avatar
mwtidd mwtidd is offline
Registered User
AKA: mike
FRC #0319 (Big Bad Bob)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 2003
Location: Boston, MA
Posts: 714
mwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond repute
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
        }
    }
    
}
__________________
"Never let your schooling interfere with your education" -Mark Twain
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 07:42 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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