public abstract class _RobotBase extends Object implements IBasicRobot, Runnable
You should create a robot that is derived from the Robot, AdvancedRobot,
JuniorRobot, TeamRobot, or RateControlRobot class instead.
Robot,
JuniorRobot,
AdvancedRobot,
TeamRobot,
RateControlRobot| Modifier and Type | Field and Description |
|---|---|
PrintStream |
out
The output stream your robot should use to print.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
finalize()
Called by the system to 'clean up' after your robot.
|
void |
setOut(PrintStream out)
Do not call this method!
|
void |
setPeer(IBasicRobotPeer peer)
Do not call this method!
|
String |
toString() |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitgetBasicEventListener, getRobotRunnablepublic PrintStream out
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());
}
protected final void finalize()
throws Throwable
public final void setOut(PrintStream out)
This method is called by the game when setting the output stream for your robot.
setOut in interface IBasicRobotout - the new output print stream for this robotpublic final void setPeer(IBasicRobotPeer peer)
This method is called by the game. A robot peer is the object that deals with game mechanics and rules, and makes sure your robot abides by them.
setPeer in interface IBasicRobotpeer - the robot peer supplied by the gameCopyright © 2021 Robocode. All Rights Reserved.