robocode.control.snapshot
Interface IBulletSnapshot


public interface IBulletSnapshot

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

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

Method Summary
 int getBulletId()
          Returns the ID of the bullet used for identifying the bullet in a collection of bullets.
 int getColor()
          Returns the color of the bullet.
 int getExplosionImageIndex()
          Returns the explosion image index, which is different depending on the type of explosion.
 int getFrame()
          Returns the current frame number to display, i.e. when the bullet explodes.
 double getHeading()
           
 int getOwnerIndex()
           
 double getPaintX()
          Returns the X painting position of the bullet.
 double getPaintY()
          Returns the Y painting position of the bullet.
 double getPower()
          Returns the bullet power.
 BulletState getState()
          Returns the bullet state.
 int getVictimIndex()
           
 double getX()
          Returns the X position of the bullet.
 double getY()
          Returns the Y position of the bullet.
 boolean isExplosion()
          Checks if the bullet has become an explosion, i.e. when it a robot or bullet has been hit.
 

Method Detail

getState

BulletState getState()
Returns the bullet state.

Returns:
the bullet state.

getPower

double getPower()
Returns the bullet power.

Returns:
the bullet power.

getX

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

Returns:
the X position of the bullet.

getY

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

Returns:
the Y position of the bullet.

getPaintX

double getPaintX()
Returns the X painting position of the bullet. Note that this is not necessarily equal to the X position of the bullet, even though it will be in most cases. The painting position of the bullet is needed as the bullet will "stick" to its victim when it has been hit, but only visually.

Returns:
the X painting position of the bullet.

getPaintY

double getPaintY()
Returns the Y painting position of the bullet. Note that this is not necessarily equal to the Y position of the bullet, even though it will be in most cases. The painting position of the bullet is needed as the bullet will "stick" to its victim when it has been hit, but only visually.

Returns:
the Y painting position of the bullet.

getColor

int getColor()
Returns the color of the bullet.

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()

getFrame

int getFrame()
Returns the current frame number to display, i.e. when the bullet explodes.

Returns:
the current frame number.
See Also:
isExplosion(), getExplosionImageIndex()

isExplosion

boolean isExplosion()
Checks if the bullet has become an explosion, i.e. when it a robot or bullet has been hit.

Returns:
true if the bullet is an explosion; false otherwise.
See Also:
getFrame(), getExplosionImageIndex()

getExplosionImageIndex

int getExplosionImageIndex()
Returns the explosion image index, which is different depending on the type of explosion. E.g. if it is a small explosion on a robot that has been hit by this bullet, or a big explosion when a robot dies.

Returns:
the explosion image index.
See Also:
isExplosion(), getExplosionImageIndex()

getBulletId

int getBulletId()
Returns the ID of the bullet used for identifying the bullet in a collection of bullets.

Returns:
the ID of the bullet.

getHeading

double getHeading()
Returns:
heading of the bullet

getVictimIndex

int getVictimIndex()
Returns:
contestantIndex of the victim, or -1 if still in air

getOwnerIndex

int getOwnerIndex()
Returns:
contestantIndex of the owner


Copyright © 2013 Robocode. All Rights Reserved.