Package dev.robocode.tankroyale.botapi
Class BulletState
java.lang.Object
dev.robocode.tankroyale.botapi.BulletState
Represents the state of a bullet that has been fired by a bot.
-
Constructor Summary
ConstructorDescriptionBulletState
(int bulletId, int ownerId, double power, double x, double y, double direction, Color color) Initializes a new instance of the BulletState class. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the unique id of the bullet.getColor()
Returns the color of the bullet.double
Returns the direction of the bullet in degrees.int
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 Details
-
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 Details
-
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
-