Package dev.robocode.tankroyale.botapi
Class BotState
java.lang.Object
dev.robocode.tankroyale.botapi.BotState
-
Constructor Summary
ConstructorDescriptionBotState
(boolean isDroid, double energy, double x, double y, double direction, double gunDirection, double radarDirection, double radarSweep, double speed, double turnRate, double gunTurnRate, double radarTurnRate, double gunHeat, Color bodyColor, Color turretColor, Color radarColor, Color bulletColor, Color scanColor, Color tracksColor, Color gunColor) Initializes a new instance of the BotState class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the color the body.Returns the color of the bullets when fired.double
Returns the driving direction of the bot in degrees.double
Returns the energy level of the bot.Returns the color of the gun.double
Returns the gun direction of the bot in degrees.double
Returns the gun heat.double
Returns the turn rate of the gun in degrees per turn (can be positive and negative).Returns the color of the radar.double
Returns the radar direction of the bot in degrees.double
Returns the radar sweep angle in degrees, i.e.double
Returns the turn rate of the radar in degrees per turn (can be positive and negative).Returns the color of the scan arc.double
getSpeed()
Returns the speed measured in units per turn.Returns the color of the tracks.double
Returns the turn rate of the body in degrees per turn (can be positive and negative).Returns the color of the gun turret.double
getX()
Returns the X coordinate of the bot, which is in the center of the bot.double
getY()
Returns the Y coordinate of the bot, which is in the center of the bot.boolean
isDroid()
Returns the flag specifying if the bot is a droid or not.
-
Constructor Details
-
BotState
public BotState(boolean isDroid, double energy, double x, double y, double direction, double gunDirection, double radarDirection, double radarSweep, double speed, double turnRate, double gunTurnRate, double radarTurnRate, double gunHeat, Color bodyColor, Color turretColor, Color radarColor, Color bulletColor, Color scanColor, Color tracksColor, Color gunColor) Initializes a new instance of the BotState class.- Parameters:
isDroid
- is the flag specifying if the bot is a droid.energy
- is the energy level.x
- is the X coordinate.y
- is the Y coordinate.direction
- is the driving direction in degrees.gunDirection
- is the gun direction in degrees.radarDirection
- is the radar direction in degrees.radarSweep
- is the radar sweep angle in degrees.speed
- is the speed measured in units per turn.turnRate
- is the turn rate of the body in degrees per turn.gunTurnRate
- is the turn rate of the gun in degrees per turn.radarTurnRate
- is the turn rate of the radar in degrees per turn.gunHeat
- is the gun heat.bodyColor
- is the body color.turretColor
- is the gun turret color.radarColor
- is the radar color.bulletColor
- is the bullet color.scanColor
- is the scan arc color.tracksColor
- is the tracks color.gunColor
- is the gun color.
-
-
Method Details
-
isDroid
public boolean isDroid()Returns the flag specifying if the bot is a droid or not.- Returns:
true
if the bot is a droid;false
otherwise.
-
getEnergy
public double getEnergy()Returns the energy level of the bot. The energy level is typically starting at 100. The bot gains more energy when hitting other bots, and loses energy by getting hit and when spending energy on firing bullets. When the energy reaches 0, the bot becomes disabled and will not be able to take any new action. It might become active again, if one of its bullets hit another bot, meaning that the bot gains new energy.- Returns:
- The energy level.
-
getX
public double getX()Returns the X coordinate of the bot, which is in the center of the bot.- Returns:
- The X coordinate.
-
getY
public double getY()Returns the Y coordinate of the bot, which is in the center of the bot.- Returns:
- The Y coordinate.
-
getDirection
public double getDirection()Returns the driving direction of the bot in degrees.- Returns:
- The driving direction.
-
getGunDirection
public double getGunDirection()Returns the gun direction of the bot in degrees.- Returns:
- The gun direction.
-
getRadarDirection
public double getRadarDirection()Returns the radar direction of the bot in degrees.- Returns:
- The radar direction.
-
getRadarSweep
public double getRadarSweep()Returns the radar sweep angle in degrees, i.e. delta angle between previous and current radar direction.- Returns:
- The radar sweep angle.
-
getSpeed
public double getSpeed()Returns the speed measured in units per turn.- Returns:
- The speed.
-
getTurnRate
public double getTurnRate()Returns the turn rate of the body in degrees per turn (can be positive and negative).- Returns:
- the turn rate.
-
getGunTurnRate
public double getGunTurnRate()Returns the turn rate of the gun in degrees per turn (can be positive and negative).- Returns:
- the gun turn rate.
-
getRadarTurnRate
public double getRadarTurnRate()Returns the turn rate of the radar in degrees per turn (can be positive and negative).- Returns:
- the radar turn rate.
-
getGunHeat
public double getGunHeat()Returns the gun heat. When firing the gun, it will be heated up. The gun will need to cool down before it can fire another bullet. When the gun heat is zero, the gun will be able to fire again.- Returns:
- The gun heat.
-
getBodyColor
-
getTurretColor
Returns the color of the gun turret.- Returns:
- The color of the gun turret.
-
getRadarColor
-
getBulletColor
Returns the color of the bullets when fired.- Returns:
- The color of the bullets when fired.
-
getScanColor
-
getTracksColor
-
getGunColor
-