robocode.control.snapshot
Interface IMineSnapshot


public interface IMineSnapshot

Interface of a mine snapshot at a specific time in a battle. Basically a copy-paste of IBulletSnapshot, which is why I added Flemming and Pavel in the authorlist.

Since:
1.9.2.2
Author:
Thales B.V. / Thomas Hakkers (original), Pavel Savara (contributor), Flemming N. Larsen (contributor)

Method Summary
 int getColor()
          Returns the color of the mine.
 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 mine explodes.
 int getMineId()
          Returns the ID of the mine used for identifying the mine in a collection of mines.
 int getOwnerIndex()
           
 double getPower()
          Returns the mine power.
 MineState getState()
          Returns the mine state.
 int getVictimIndex()
           
 double getX()
          Returns the X position of the mine.
 double getY()
          Returns the Y position of the mine.
 boolean isExplosion()
          Checks if the mine has become an explosion, i.e. when a robot or mine has been hit.
 

Method Detail

getState

MineState getState()
Returns the mine state.

Returns:
the mine state.

getPower

double getPower()
Returns the mine power.

Returns:
the mine power.

getX

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

Returns:
the X position of the mine.

getY

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

Returns:
the Y position of the mine.

getColor

int getColor()
Returns the color of the mine.

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 mine explodes.

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

isExplosion

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

Returns:
true if the mine 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 mine, or a big explosion when a robot dies.

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

getMineId

int getMineId()
Returns the ID of the mine used for identifying the mine in a collection of mines.

Returns:
the ID of the mine.

getVictimIndex

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

getOwnerIndex

int getOwnerIndex()
Returns:
contestantIndex of the owner


Copyright © 2015 Robocode. All Rights Reserved.