robocode.control.snapshot
Interface IRobotSnapshot


public interface IRobotSnapshot

Interface of a robot snapshot at a specific time in a battle.

Since:
1.6.2
Author:
Pavel Savara (original), Flemming N. Larsen (contributor)

Method Summary
 int getBodyColor()
          Returns the color of the body.
 double getBodyHeading()
          Returns the body heading of the robot in radians.
 int getContestantIndex()
          Returns the contestant index, which is unique for each robot or team participating in a battle.
 IDebugProperty[] getDebugProperties()
          Returns a snapshot of debug properties.
 double getEnergy()
          Returns the energy level of the robot.
 int getGunColor()
          Returns the color of the gun.
 double getGunHeading()
          Returns the gun heading of the robot in radians.
 double getGunHeat()
          Returns the gun heat of the robot.
 String getName()
          Returns the name of the robot.
 String getOutputStreamSnapshot()
          Returns a snapshot of the output print stream for this robot.
 int getRadarColor()
          Returns the color of the radar.
 double getRadarHeading()
          Returns the radar heading of the robot in radians.
 int getRobotIndex()
          Returns the index of the robot, which is unique for the specific robot and constant during a battle.
 int getScanColor()
          Returns the color of the scan arc.
 IScoreSnapshot getScoreSnapshot()
          Returns a snapshot of the current score for this robot.
 String getShortName()
          Returns the short name of the robot.
 RobotState getState()
          Returns the robot state.
 int getTeamIndex()
          Returns the index of the team that this robot is a member of, which is unique for the specific team and constant during a battle.
 String getTeamName()
          Returns the name of the team, which can be the name of a robot if the contestant is not a team, but a robot.
 double getVelocity()
          Returns the velocity of the robot.
 String getVeryShortName()
          Returns the very short name of the robot.
 double getX()
          Returns the X position of the robot.
 double getY()
          Returns the Y position of the robot.
 boolean isDroid()
          Checks if this robot is a Droid.
 boolean isPaintEnabled()
          Checks if painting is enabled for this robot.
 boolean isPaintRobot()
          Checks if this robot is a IPaintRobot or is invoking getGraphics()
 boolean isSGPaintEnabled()
          Checks if RobocodeSG painting (the point (0,0) is in the upper left corner) is enabled for this robot.
 

Method Detail

getName

String getName()
Returns the name of the robot.

Returns:
the name of the robot.

getShortName

String getShortName()
Returns the short name of the robot.

Returns:
the short name of the robot.

getVeryShortName

String getVeryShortName()
Returns the very short name of the robot.

Returns:
the very short name of the robot.

getTeamName

String getTeamName()
Returns the name of the team, which can be the name of a robot if the contestant is not a team, but a robot.

Returns:
the name of the team.

getRobotIndex

int getRobotIndex()
Returns the index of the robot, which is unique for the specific robot and constant during a battle.

Returns:
the robot index.
Since:
1.7.4
See Also:
getTeamIndex()

getTeamIndex

int getTeamIndex()
Returns the index of the team that this robot is a member of, which is unique for the specific team and constant during a battle.

Returns:
the team index or -1 if the robot is not a member of a team.
Since:
1.7.4
See Also:
getRobotIndex()

getContestantIndex

int getContestantIndex()
Returns the contestant index, which is unique for each robot or team participating in a battle. Note: If a team of robots is participating in a battle, this method will return the team index (see getTeamIndex()); otherwise the robot index (see getRobotIndex()) is used instead. This method is used for the battle results as scores are calculated for either a team of robots or individual robot.

Returns:
the contestant index of the robot or team.
See Also:
getRobotIndex(), getTeamIndex()

getState

RobotState getState()
Returns the robot state.

Returns:
the robot state.

getEnergy

double getEnergy()
Returns the energy level of the robot.

Returns:
the energy level of the robot.

getVelocity

double getVelocity()
Returns the velocity of the robot.

Returns:
the velocity of the robot.

getBodyHeading

double getBodyHeading()
Returns the body heading of the robot in radians.

Returns:
the body heading of the robot in radians.

getGunHeading

double getGunHeading()
Returns the gun heading of the robot in radians.

Returns:
the gun heading of the robot in radians.

getRadarHeading

double getRadarHeading()
Returns the radar heading of the robot in radians.

Returns:
the radar heading of the robot in radians.

getGunHeat

double getGunHeat()
Returns the gun heat of the robot.

Returns:
the gun heat of the robot.

getX

double getX()
Returns the X position of the robot.

Returns:
the X position of the robot.

getY

double getY()
Returns the Y position of the robot.

Returns:
the Y position of the robot.

getBodyColor

int getBodyColor()
Returns the color of the body.

Returns:
an ARGB color value. (Bits 24-31 are alpha, 16-23 are red, 8-15 are green, 0-7 are blue)
See Also:
Color.getRGB()

getGunColor

int getGunColor()
Returns the color of the gun.

Returns:
an ARGB color value. (Bits 24-31 are alpha, 16-23 are red, 8-15 are green, 0-7 are blue)
See Also:
Color.getRGB()

getRadarColor

int getRadarColor()
Returns the color of the radar.

Returns:
an ARGB color value. (Bits 24-31 are alpha, 16-23 are red, 8-15 are green, 0-7 are blue)
See Also:
Color.getRGB()

getScanColor

int getScanColor()
Returns the color of the scan arc.

Returns:
an ARGB color value. (Bits 24-31 are alpha, 16-23 are red, 8-15 are green, 0-7 are blue)
See Also:
Color.getRGB()

isDroid

boolean isDroid()
Checks if this robot is a Droid.

Returns:
true if this robot is a Droid; false otherwise.

isPaintRobot

boolean isPaintRobot()
Checks if this robot is a IPaintRobot or is invoking getGraphics()

Returns:
true if this robot is a painting; false otherwise.

isPaintEnabled

boolean isPaintEnabled()
Checks if painting is enabled for this robot.

Returns:
true if painting is enabled for this robot; false otherwise.

isSGPaintEnabled

boolean isSGPaintEnabled()
Checks if RobocodeSG painting (the point (0,0) is in the upper left corner) is enabled for this robot.

Returns:
true if RobocodeSG painting is enabled for this robot; false otherwise.

getDebugProperties

IDebugProperty[] getDebugProperties()
Returns a snapshot of debug properties.

Returns:
a snapshot of debug properties.

getOutputStreamSnapshot

String getOutputStreamSnapshot()
Returns a snapshot of the output print stream for this robot.

Returns:
a string containing the snapshot of the output print stream.

getScoreSnapshot

IScoreSnapshot getScoreSnapshot()
Returns a snapshot of the current score for this robot.

Returns:
a snapshot of the current score for this robot.


Copyright © 2013 Robocode. All Rights Reserved.