robocode.robotinterfaces
Interface IBasicRobot
- IAdvancedRobot, IInteractiveRobot, IJuniorRobot, IPaintRobot, ITeamRobot
- AdvancedRobot, JuniorRobot, Robot, TeamRobot
public interface IBasicRobot
A robot interface for creating a basic type of robot like
Robot
that is able to receive common robot events, but not interactive events as
with the
Robot
class.
A basic robot allows blocking calls only and cannot handle custom events nor
writes to the file system like an advanced robot.
- Pavel Savara (original)
- Flemming N. Larsen (javadoc)
IBasicEvents | getBasicEventListener() - This method is called by the game to notify this robot about basic
robot event.
|
Runnable | getRobotRunnable() - This method is called by the game to invoke the
run() method of your robot, where the program
of your robot is implemented.
|
void | setOut(PrintStream out) - Do not call this method!
This method is called by the game when setting the output stream for your
robot.
|
void | setPeer(IBasicRobotPeer peer) - Do not call this method! Your robot will simply stop interacting with
the game.
|
getBasicEventListener
public IBasicEvents getBasicEventListener()
This method is called by the game to notify this robot about basic
robot event. Hence, this method must be implemented so it returns your
IBasicEvents
listener.
- listener to basic events or
null
if this robot should
not receive the notifications.
getRobotRunnable
public Runnable getRobotRunnable()
This method is called by the game to invoke the
run()
method of your robot, where the program
of your robot is implemented.
- a runnable implementation
setOut
public void setOut(PrintStream out)
Do not call this method!
This method is called by the game when setting the output stream for your
robot.
out
- the new output print stream for this robot
setPeer
public 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.
peer
- the robot peer supplied by the game