robocode.control.snapshot
Interface IBulletSnapshot


public interface IBulletSnapshot

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

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

Method Summary
 int getBulletId()
           
 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 frame number to display, i.e. when the bullet explodes.
 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.
 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.
 

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, 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, but only visually.

Returns:
the Y painting position of the bullet.

getColor

int getColor()
Returns the color of the bullet.

Returns:
a 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 frame number to display, i.e. when the bullet explodes.

Returns:
the frame number.

isExplosion

boolean isExplosion()
Checks if the bullet has become an explosion.

Returns:
true if the bullet is an explosion; false otherwise.

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.

getBulletId

int getBulletId()


Copyright © 2010 Robocode. All Rights Reserved.