This interface is implemented by all objects in the game. It allows you to get the location of any object, and to determine the distance and heading to or from the object.
Method Summary | |
---|---|
int |
getDirectionTo(int x,
int y)
Returns the approximate direction (the closest of the 8 possible move directions) to the given position from this object. |
int |
getDistanceTo(int x,
int y)
Returns the minimum number of squares (units) between this object and the given position. |
int |
getId()
Returns the id of this object. |
IRuler |
getRuler()
Returns the ruler that commands this object. |
int |
getX()
Returns the X position of the object. |
int |
getY()
Returns the Y position of the object. |
boolean |
isAlive()
Returns true if this object is alive, and false otherwise. |
Method Detail |
public int getDirectionTo(int x, int y)
public int getDistanceTo(int x, int y)
public int getId()
public IRuler getRuler()
public int getX()
public int getY()
public boolean isAlive()