robocode

Class _RobotBase

Implemented Interfaces:
IBasicRobot, Runnable
Known Direct Subclasses:
JuniorRobot, _Robot

public abstract class _RobotBase
extends Object
implements IBasicRobot, Runnable

This is the base class of all robots used by the system. You should not base your robots on this class.

You should create a robot that is derived from the Robot or JuniorRobot class instead.

There is no guarantee that this class will exist in future versions of Robocode.

Authors:
Flemming N. Larsen (original)
Pavel Savara (contributor)
Since:
1.4
See Also:
Robot, JuniorRobot, AdvancedRobot, TeamRobot

Field Summary

PrintStream
out
The output stream your robot should use to print.

Method Summary

void
setOut(PrintStream out)
void
setPeer(IBasicRobotPeer peer)

Field Details

out

public PrintStream out
The output stream your robot should use to print.

You can view the print-outs by clicking the button for your robot in the right side of the battle window.

Example:

   // Print out a line each time my robot hits another robot
   public void onHitRobot(HitRobotEvent e) {
       out.println("I hit a robot!  My energy: " + getEnergy() + " his energy: " + e.getEnergy());
   }
 

Method Details

setOut

public final void setOut(PrintStream out)
Specified by:
setOut in interface IBasicRobot

setPeer

public final void setPeer(IBasicRobotPeer peer)
Specified by:
setPeer in interface IBasicRobot