Package robocode

# Class _RobotBase

java.lang.Object
robocode._RobotBase

All Implemented Interfaces:
  `Runnable`, `IBasicRobot`

Direct Known Subclasses:
  `_Robot`, `JuniorRobot`

public abstract class _RobotBase extends Object implements IBasicRobot, Runnable
This is the base class of all robots used by the system. You should not inherit your robot on this class.

You should create a robot that is derived from the `Robot`, `AdvancedRobot`, `JuniorRobot`, `TeamRobot`, or `RateControlRobot` class instead.

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

## Field Summary

Fields
Modifier and Type
Field
Description
`PrintStream`
`out`
The output stream your robot should use to print.

## Method Summary

Modifier and Type
Method
Description
`protected final void`
`finalize()`
Called by the system to 'clean up' after your robot.
`final void`
`setOut(PrintStream out)`
Do not call this method!
`final void`
`setPeer(IBasicRobotPeer peer)`
Do not call this method! Your robot will simply stop interacting with the game.

### Methods inherited from class java.lang.Object

`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface robocode.robotinterfaces.IBasicRobot

`getBasicEventListener, getRobotRunnable`

### Methods inherited from interface java.lang.Runnable

`run`

## 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

### finalize

protected final void finalize() throws Throwable
Called by the system to 'clean up' after your robot. You may not override this method.

Overrides:
  `finalize` in class `Object`
Throws:
  `Throwable`

### setOut

public final void setOut(PrintStream out)
Do not call this method!

This method is called by the game when setting the output stream for your robot.

Specified by:
  `setOut` in interface `IBasicRobot`
Parameters:
  `out` - the new output print stream for this robot

### setPeer

public final void setPeer(IBasicRobotPeer peer)
Do not call this method! Your robot will simply stop interacting with the game.

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.

Specified by:
  `setPeer` in interface `IBasicRobot`
Parameters:
  `peer` - the robot peer supplied by the game