public final class BattleRules extends Object implements Serializable
BattleStartedEvent.getBattleRules()
when a battle is started and
BattleCompletedEvent.getBattleRules()
when a battle is completed.BattleStartedEvent
,
BattleCompletedEvent
,
Serialized FormConstructor and Description |
---|
BattleRules(robocode.battle.BattleProperties battleProperties)
Do not call this constructor! This constructor is intended for the game alone.
|
Modifier and Type | Method and Description |
---|---|
int |
getBattlefieldHeight()
Returns the battlefield height.
|
int |
getBattlefieldWidth()
Returns the battlefield width.
|
double |
getGunCoolingRate()
Returns the rate at which the gun will cool down, i.e.
|
long |
getInactivityTime()
Returns the allowed inactivity time, where the robot is not taking any action, before will begin to be zapped.
|
int |
getNumRounds()
Returns the number of rounds.
|
public BattleRules(robocode.battle.BattleProperties battleProperties)
battleProperties
- the battle properties that this object will copy from.public int getBattlefieldWidth()
public int getBattlefieldHeight()
public int getNumRounds()
public double getGunCoolingRate()
Robot.getGunHeat()
,
Robot.fire(double)
,
Robot.fireBullet(double)
public long getInactivityTime()
Robot.doNothing()
,
AdvancedRobot.execute()