public class BattleStartedEvent extends BattleEvent
onBattleStarted()
when a new battle is started.IBattleListener
,
BattleCompletedEvent
,
BattleFinishedEvent
Constructor and Description |
---|
BattleStartedEvent(BattleRules battleRules,
int robotsCount,
boolean isReplay,
UUID battleId)
Called by the game to create a new BattleStartedEvent.
|
Modifier and Type | Method and Description |
---|---|
UUID |
getBattleId()
Unique ID of the battle
|
BattleRules |
getBattleRules()
Returns the rules that will be used in the battle.
|
int |
getRobotsCount()
Returns the number of robots participating in the battle.
|
boolean |
isReplay()
Checks if this battle is a replay or a new battle.
|
public BattleStartedEvent(BattleRules battleRules, int robotsCount, boolean isReplay, UUID battleId)
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:
true
if the battle is a replay; false
otherwise.battleId
- unique id of the battlepublic BattleRules getBattleRules()
public int getRobotsCount()
public boolean isReplay()
true
if the battle is a replay; false
otherwise.public UUID getBattleId()
Copyright © 2021 Robocode. All Rights Reserved.