java.lang.Object | +--com.ibm.ruler.World
This class allows you to get information about the CodeRuler environment.
Field Summary | |
---|---|
static int |
HEIGHT
The height of the "world" in units. |
static int |
MAX_TURNS
The maximum number of turns in each match. |
static int |
WIDTH
The width of the "world" in units. |
Method Summary | |
---|---|
static int |
getCurrentTurn()
Returns the number of turns that have occurred so far during this match. |
static IRuler |
getLandOwner(int x,
int y)
Returns the ruler that has claimed the land at the given position, or null if the position is out of bounds or no ruler has claimed the land. |
static IObject |
getObjectAt(int x,
int y)
Returns the peasant, knight, or castle that is at the given location, or null if there is nothing at the given location or it is out of bounds. |
static ICastle[] |
getOtherCastles()
Returns an array of all the castles from other rulers that are currently in this match. |
static IKnight[] |
getOtherKnights()
Returns an array of all the knights from other rulers that are currently in this match. |
static IPeasant[] |
getOtherPeasants()
Returns an array of all the peasants from other rulers that are currently in this match. |
static IRuler[] |
getOtherRulers()
Returns an array of all the other rulers that you are currently competing against in this match. |
static java.awt.Point |
getPositionAfterMove(int x,
int y,
int direction)
Returns the coordinates of the square in the given direction from the given point. |
Method Detail |
public static int getCurrentTurn()
public static IRuler getLandOwner(int x, int y)
x
- - An x positiony
- - A y position
public static IObject getObjectAt(int x, int y)
x
- - An x positiony
- - A y position
public static ICastle[] getOtherCastles()
public static IKnight[] getOtherKnights()
public static IPeasant[] getOtherPeasants()
public static IRuler[] getOtherRulers()
public static java.awt.Point getPositionAfterMove(int x, int y, int direction)
x
- - An x positiony
- - A y positiondirection
- - The direction in which to return the position