Package robocode.robotinterfaces
Interface IBasicRobot
- All Known Subinterfaces:
IAdvancedRobot,IInteractiveRobot,IJuniorRobot,IPaintRobot,ITeamRobot
- All Known Implementing Classes:
_AdvancedRadiansRobot,_AdvancedRobot,_Robot,_RobotBase,AdvancedRobot,JuniorRobot,RateControlRobot,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.- Since:
- 1.6
- Author:
- Pavel Savara (original), Flemming N. Larsen (contributor)
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionThis method is called by the game to notify this robot about basic robot event.This method is called by the game to invoke therun()method of your robot, where the program of your robot is implemented.voidsetOut(PrintStream out) Do not call this method!voidsetPeer(IBasicRobotPeer peer) Do not call this method! Your robot will simply stop interacting with the game.
-
Method Details
-
getRobotRunnable
Runnable getRobotRunnable()This method is called by the game to invoke therun()method of your robot, where the program of your robot is implemented.- Returns:
- a runnable implementation
- Since:
- 1.6
- See Also:
-
getBasicEventListener
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 yourIBasicEventslistener.- Returns:
- listener to basic events or
nullif this robot should not receive the notifications. - Since:
- 1.6
-
setPeer
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.
- Parameters:
peer- the robot peer supplied by the game
-
setOut
Do not call this method!This method is called by the game when setting the output stream for your robot.
- Parameters:
out- the new output print stream for this robot- Since:
- 1.6
-