Package robocode.control.events
Class BattleStartedEvent
java.lang.Object
robocode.control.events.BattleEvent
robocode.control.events.BattleStartedEvent
A BattleStartedEvent is sent to
onBattleStarted() when a new battle is started.- Since:
- 1.6.2
- Author:
- Pavel Savara (original), Flemming N. Larsen (contributor)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBattleStartedEvent(BattleRules battleRules, int robotsCount, boolean isReplay) Called by the game to create a new BattleStartedEvent. -
Method Summary
Modifier and TypeMethodDescriptionReturns the rules that will be used in the battle.intReturns the number of robots participating in the battle.booleanisReplay()Checks if this battle is a replay or a new battle.
-
Constructor Details
-
BattleStartedEvent
Called by the game to create a new BattleStartedEvent. Please don't use this constructor as it might change.- Parameters:
battleRules- the rules that will be used in the battle.robotsCount- the number of robots participating in the battle.isReplay- a flag specifying if this battle is a replay or real battle:trueif the battle is a replay;falseotherwise.
-
-
Method Details
-
getBattleRules
Returns the rules that will be used in the battle.- Returns:
- the rules that will be used in the battle.
-
getRobotsCount
public int getRobotsCount()Returns the number of robots participating in the battle.- Returns:
- the number of robots participating in the battle.
-
isReplay
public boolean isReplay()Checks if this battle is a replay or a new battle.- Returns:
trueif the battle is a replay;falseotherwise.
-