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 FormModifier 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. the amount of heat the gun heat will drop per turn.
|
boolean |
getHideEnemyNames() |
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.
|
int |
getSentryBorderSize()
Returns the sentry border size for a
BorderSentry that defines the how
far a BorderSentry is allowed to move from the border edges measured in units. |
public int getBattlefieldWidth()
public int getBattlefieldHeight()
public int getNumRounds()
public double getGunCoolingRate()
The gun cooling rate is default 0.1 per turn, but can be changed by the battle setup. So don't count on the cooling rate being 0.1!
Robot.getGunHeat()
,
Robot.fire(double)
,
Robot.fireBullet(double)
public long getInactivityTime()
When a robot is zapped by the game, it will loose 0.1 energy points per turn. Eventually the robot will be killed by zapping until the robot takes action. When the robot takes action, the inactivity time counter is reset.
The allowed inactivity time is per default 450 turns, but can be changed by the battle setup. So don't count on the inactivity time being 450 turns!
Robot.doNothing()
,
AdvancedRobot.execute()
public boolean getHideEnemyNames()
public int getSentryBorderSize()
BorderSentry
that defines the how
far a BorderSentry is allowed to move from the border edges measured in units.Copyright © 2021 Robocode. All Rights Reserved.