public interface IRobocodeEngine
Modifier and Type | Method and Description |
---|---|
void |
abortCurrentBattle()
Aborts the current battle if it is running and waits for the end.
|
void |
abortCurrentBattle(boolean waitTillEnd)
Aborts the current battle if it is running.
|
void |
addBattleListener(IBattleListener listener)
Adds a battle listener that must receive events occurring in battles.
|
void |
close()
Closes the RobocodeEngine and releases any allocated resources it holds.
|
RobotSpecification[] |
getLocalRepository()
Returns all robots available from the local robot repository of Robocode.
|
RobotSpecification[] |
getLocalRepository(String selectedRobotList)
Returns a selection of robots available from the local robot repository
of Robocode.
|
String |
getVersion()
Returns the installed version of Robocode controlled by this RobocodeEngine.
|
void |
removeBattleListener(IBattleListener listener)
Removes a battle listener that has previously been added to this object.
|
void |
runBattle(BattleSpecification battleSpecification)
Runs the specified battle.
|
void |
runBattle(BattleSpecification battleSpecification,
boolean waitTillOver)
Runs the specified battle.
|
void |
runBattle(BattleSpecification battleSpecification,
String initialPositions,
boolean waitTillOver)
Runs the specified battle.
|
void |
runBattle(BattleSpecification battleSpecification,
String initialPositions,
boolean waitTillOver,
boolean enableRecording) |
void |
setVisible(boolean visible)
Shows or hides the Robocode window.
|
void |
takeScreenshot()
Saves screenshot to disk, if the UI is initialized
|
void |
waitTillBattleOver()
Will block caller until current battle is over.
|
void addBattleListener(IBattleListener listener)
listener
- the battle listener that must retrieve the event from
the battles.removeBattleListener(robocode.control.events.IBattleListener)
void removeBattleListener(IBattleListener listener)
listener
- the battle listener that must be removed.addBattleListener(robocode.control.events.IBattleListener)
void close()
String getVersion()
void setVisible(boolean visible)
visible
- true
if the Robocode window must be set visible;
false
otherwise.RobotSpecification[] getLocalRepository()
RobotSpecification
,
getLocalRepository(String)
RobotSpecification[] getLocalRepository(String selectedRobotList)
Notice: If a specified robot cannot be found in the repository, it will not be returned in the array of robots returned by this method.
selectedRobotList
- a comma or space separated list of robots to
return. The full class name must be used for
specifying the individual robot, e.g.
"sample.Corners, sample.Crazy".selectedRobotList
parameter.RobotSpecification
,
getLocalRepository()
void runBattle(BattleSpecification battleSpecification)
battleSpecification
- the specification of the battle to run including the
participation robots.runBattle(robocode.control.BattleSpecification, boolean)
,
BattleSpecification
,
getLocalRepository()
void runBattle(BattleSpecification battleSpecification, boolean waitTillOver)
battleSpecification
- the specification of the battle to run including the
participating robots.waitTillOver
- will block caller till end of battle if setrunBattle(robocode.control.BattleSpecification)
,
BattleSpecification
,
getLocalRepository()
void runBattle(BattleSpecification battleSpecification, String initialPositions, boolean waitTillOver)
battleSpecification
- the specification of the battle to run including the
participating robots.initialPositions
- a comma or space separated list like: x1,y1,heading1,
x2,y2,heading2, which are the coordinates and heading of robot #1 and #2.
So e.g. 0,0,180, 50,80,270 means that robot #1 has position (0,0) and
heading 180, and robot #2 has position (50,80) and heading 270.waitTillOver
- will block caller till end of battle if setrunBattle(BattleSpecification)
,
BattleSpecification
,
getLocalRepository()
void runBattle(BattleSpecification battleSpecification, String initialPositions, boolean waitTillOver, boolean enableRecording)
void waitTillBattleOver()
void abortCurrentBattle()
void abortCurrentBattle(boolean waitTillEnd)
waitTillEnd
- will block caller until the battle is overrunBattle(robocode.control.BattleSpecification)
void takeScreenshot()
Copyright © 2021 Robocode. All Rights Reserved.