robocode.control
Class RobocodeEngine
public class RobocodeEngine
The RobocodeEngine is meant for 3rd party applications to let them run
battles in Robocode and receive the results. This class in the main class
of the robocode.control
package.
- Mathew A. Nelson (original)
- Flemming N. Larsen (contributor)
- Robert D. Maupin (contributor)
- Nathaniel Troutman (contributor)
RobocodeEngine
public RobocodeEngine(File robocodeHome,
RobocodeListener listener)
Creates a new RobocodeEngine for controlling Robocode.
robocodeHome
- the root directory of Robocode, e.g. C:\Robocode.listener
- the listener that must receive the callbacks from this
RobocodeEngine.
RobocodeEngine
public RobocodeEngine(RobocodeListener listener)
listener
- the listener that must receive the callbacks from this
RobocodeEngine.
abortCurrentBattle
public void abortCurrentBattle()
Aborts the current battle if it is running.
close
public void close()
Closes the RobocodeEngine and releases any allocated resources.
You should call this when you have finished using the RobocodeEngine.
This method automatically disposes the Robocode window if it open.
getLocalRepository
public RobotSpecification[] getLocalRepository()
Returns the robots available for for battle from the local robot
repository in the Robocode home folder.
- an array of all available robots for battle from the local robot
repository.
getVersion
public String getVersion()
Returns the installed version of Robocode.
- the installed version of Robocode.
runBattle
public void runBattle(BattleSpecification battle)
Runs the specified battle.
battle
- the specification of the battle to play including the
participation robots.
setVisible
public void setVisible(boolean visible)
Shows or hides the Robocode window.
visible
- true
if the Robocode window must be set visible;
false
otherwise.
void finalize
public @Override void finalize()
throws Throwable