Package dev.robocode.tankroyale.botapi
Class BulletState
- java.lang.Object
-
- dev.robocode.tankroyale.botapi.BulletState
-
public final class BulletState extends java.lang.Object
Represents the state of a bullet that has been fired by a bot.
-
-
Constructor Summary
Constructors Constructor Description BulletState(int bulletId, int ownerId, double power, double x, double y, double direction, Color color)
Initializes a new instance of the BulletState class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getBulletId()
Returns the unique id of the bullet.Color
getColor()
Returns the color of the bullet.double
getDirection()
Returns the direction of the bullet in degrees.int
getOwnerId()
Returns the id of the owner bot that fired the bullet.double
getPower()
Returns the bullet firepower level.double
getSpeed()
Returns the speed of the bullet measured in units per turn.double
getX()
Returns the X coordinate of the bullet.double
getY()
Returns the Y coordinate of the bullet.
-
-
-
Constructor Detail
-
BulletState
public BulletState(int bulletId, int ownerId, double power, double x, double y, double direction, Color color)
Initializes a new instance of the BulletState class.- Parameters:
bulletId
- is the unique id of the bullet.ownerId
- is the id of the bot that fired the bullet.power
- is the bullet firepower level.x
- is the X coordinate of the bullet.y
- is the Y coordinate of the bullet.direction
- is the direction in degrees.color
- is the color of the bullet.
-
-
Method Detail
-
getBulletId
public int getBulletId()
Returns the unique id of the bullet.- Returns:
- The unique id of the bullet.
-
getOwnerId
public int getOwnerId()
Returns the id of the owner bot that fired the bullet.- Returns:
- The id of the owner bot that fired the bullet.
-
getPower
public double getPower()
Returns the bullet firepower level.- Returns:
- The bullet firepower level.
-
getX
public double getX()
Returns the X coordinate of the bullet.- Returns:
- The X coordinate of the bullet.
-
getY
public double getY()
Returns the Y coordinate of the bullet.- Returns:
- The Y coordinate of the bullet.
-
getDirection
public double getDirection()
Returns the direction of the bullet in degrees.- Returns:
- The direction of the bullet in degrees.
-
getSpeed
public double getSpeed()
Returns the speed of the bullet measured in units per turn.- Returns:
- The speed of the bullet measured in units per turn.
-
getColor
public Color getColor()
Returns the color of the bullet.- Returns:
- The color of the bullet.
-
-