Package dev.robocode.tankroyale.botapi
Class InitialPosition
java.lang.Object
dev.robocode.tankroyale.botapi.InitialPosition
Initial starting position containing a start coordinate (x,y) and the shared direction of the body, gun, and radar.
The initial position is only used when debugging to request the server to let a bot start at a specific position. Note that initial starting positions must be enabled at the server-side; otherwise the initial starting position is ignored.
-
Constructor Summary
ConstructorDescriptionInitialPosition
(Double x, Double y, Double direction) Initializes a new instance of the InitialPosition class. -
Method Summary
Modifier and TypeMethodDescriptionboolean
static InitialPosition
fromString
(String initialPosition) Creates new instance of the InitialPosition class from a string.Returns the shared direction of the body, gun, and radar;getX()
Returns the x coordinate;getY()
Returns the y coordinate;int
hashCode()
toString()
-
Constructor Details
-
InitialPosition
Initializes a new instance of the InitialPosition class.- Parameters:
x
- is the x coordinate, wherenull
means it is random.y
- is the y coordinate, wherenull
means it is random.direction
- is the shared direction of the body, gun, and radar, wherenull
means it is random.
-
-
Method Details
-
equals
-
hashCode
-
getX
Returns the x coordinate;- Returns:
- The x coordinate or
null
if no x coordinate is specified and a random value must be used.
-
getY
Returns the y coordinate;- Returns:
- The y coordinate or
null
if no y coordinate is specified and a random value must be used.
-
getDirection
Returns the shared direction of the body, gun, and radar;- Returns:
- The direction or
null
if no direction is specified and a random value must be used.
-
toString
-
fromString
Creates new instance of the InitialPosition class from a string.- Parameters:
initialPosition
- is comma and/or white-space separated string.- Returns:
- An InitialPosition instance.
-