Package dev.robocode.tankroyale.botapi
Class BotState
- java.lang.Object
-
- dev.robocode.tankroyale.botapi.BotState
-
public final class BotState extends java.lang.Object
Represents the current bot state.
-
-
Constructor Summary
Constructors Constructor Description 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Color
getBodyColor()
Returns the color the body.Color
getBulletColor()
Returns the color of the bullets when fired.double
getDirection()
Returns the driving direction of the bot in degrees.double
getEnergy()
Returns the energy level of the bot.Color
getGunColor()
Returns the color of the gun.double
getGunDirection()
Returns the gun direction of the bot in degrees.double
getGunHeat()
Returns the gun heat.double
getGunTurnRate()
Returns the turn rate of the gun in degrees per turn (can be positive and negative).Color
getRadarColor()
Returns the color of the radar.double
getRadarDirection()
Returns the radar direction of the bot in degrees.double
getRadarSweep()
Returns the radar sweep angle in degrees, i.e.double
getRadarTurnRate()
Returns the turn rate of the radar in degrees per turn (can be positive and negative).Color
getScanColor()
Returns the color of the scan arc.double
getSpeed()
Returns the speed measured in units per turn.Color
getTracksColor()
Returns the color of the tracks.double
getTurnRate()
Returns the turn rate of the body in degrees per turn (can be positive and negative).Color
getTurretColor()
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 Detail
-
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 Detail
-
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
public Color getBodyColor()
Returns the color the body.- Returns:
- The color the body.
-
getTurretColor
public Color getTurretColor()
Returns the color of the gun turret.- Returns:
- The color of the gun turret.
-
getRadarColor
public Color getRadarColor()
Returns the color of the radar.- Returns:
- The color of the radar.
-
getBulletColor
public Color getBulletColor()
Returns the color of the bullets when fired.- Returns:
- The color of the bullets when fired.
-
getScanColor
public Color getScanColor()
Returns the color of the scan arc.- Returns:
- The color of the scan arc.
-
getTracksColor
public Color getTracksColor()
Returns the color of the tracks.- Returns:
- The color of the tracks.
-
getGunColor
public Color getGunColor()
Returns the color of the gun.- Returns:
- The color of the gun.
-
-