Class RallyCar

java.lang.Object
  |
  +--com.ibm.rally.Car
        |
        +--RallyCar
All Implemented Interfaces:
ICar, IObject

public class RallyCar
extends Car

This is the class that you must implement to enable your car within the CodeRally track. Adding code to these methods will give your car it's personality and allow it to compete.


Fields inherited from class com.ibm.rally.Car
CAR_BLUE, CAR_ORANGLE, CAR_PURPLE, CAR_RED, CAR_TEAL, CAR_YELLOW, MAX_CLOCK_TICKS, MAX_STEER_LEFT, MAX_STEER_RIGHT, MAX_THROTTLE, MIN_THROTTLE
 
Method Detail

getColor

public byte getColor()
Description copied from class: Car
Returns the color of your car. This method should return one of the six CAR_XXX color constants and will only be called once during initialization.
Overrides:
getColor in class Car
See Also:
Car.getColor()

initialize

public void initialize()
Description copied from class: Car
Called to give you a chance to do initialization. This method will be called at the beginning of each match, and you will have a limited amount of time to do initialization.
Overrides:
initialize in class Car
See Also:
Car.initialize()

move

public void move(int lastMoveTime,
                 boolean hitWall,
                 ICar collidedWithCar,
                 ICar hitBySpareTire)
Description copied from class: Car
This method is called repeatedly to allow you to move your car. When you have run out of fuel, this method will no longer be called. The first parameter returns the length of time (in ms) that the last call to move() took.

The second parameter (hitWall) returns true if your car has just ran into a wall. If your car has collided with another car, the third parameter (collidedWithCar) will return that other car; otherwise this parameter will be null. If you have just been hit by a spare tire from another car, the fourth parameter (hitBySpareTire) returns that other car; otherwise this parameter will be null.

Overrides:
move in class Car
See Also:
Car.move(int, boolean, ICar, ICar)