java.lang.Object | +--com.ibm.ruler.Ruler
This class is the superclass of the Ruler that you implement. This class contains helper methods to find out about the state of the world.
Field Summary | |
---|---|
static int |
MOVE_E
|
static int |
MOVE_N
|
static int |
MOVE_NE
|
static int |
MOVE_NONE
|
static int |
MOVE_NW
|
static int |
MOVE_S
|
static int |
MOVE_SE
|
static int |
MOVE_SW
|
static int |
MOVE_W
|
Method Summary | |
---|---|
void |
capture(IKnight knight,
int direction)
Order the specified knight to capture in the given direction. |
void |
createKnights(ICastle castle)
Order the specified castle to start producing new knights. |
void |
createPeasants(ICastle castle)
Order the specified castle to start producing new peasants. |
ICastle[] |
getCastles()
Returns the castles owned by this ruler. |
IKnight[] |
getKnights()
Returns this ruler's knights. |
int |
getOwnedLandCount()
Returns the number of squares of land this ruler currently owns. |
IPeasant[] |
getPeasants()
Returns this ruler's peasants. |
int |
getPoints()
Returns the number of points that this ruler has accumulated during this match. |
abstract java.lang.String |
getRulerName()
Return the name of your ruler. |
abstract java.lang.String |
getSchoolName()
Return the name of your school. |
abstract void |
initialize()
Called to give you a chance to do initialization. |
void |
move(IKnight knight,
int direction)
Order the specified knight to move in the given direction. |
void |
move(IPeasant peasant,
int direction)
Order the specified peasant to move in the given direction. |
abstract void |
orderSubjects(int lastMoveTime)
This method is called each turn to allow you to give orders to your peasants, knights, and castles. |
Method Detail |
public final void capture(IKnight knight, int direction)
knight
- - The knight to give the order todirection
- - The direction the knight should capture inpublic final void createKnights(ICastle castle)
castle
- - The castle to give the order topublic final void createPeasants(ICastle castle)
castle
- - The castle to give the order topublic final ICastle[] getCastles()
IRuler
getCastles
in interface IRuler
public final IKnight[] getKnights()
IRuler
getKnights
in interface IRuler
public final int getOwnedLandCount()
IRuler
getOwnedLandCount
in interface IRuler
public final IPeasant[] getPeasants()
IRuler
getPeasants
in interface IRuler
public final int getPoints()
IRuler
getPoints
in interface IRuler
public abstract java.lang.String getRulerName()
getRulerName
in interface IRuler
public abstract java.lang.String getSchoolName()
getSchoolName
in interface IRuler
public abstract void initialize()
public final void move(IKnight knight, int direction)
knight
- - The knight to give the order todirection
- - The direction that the knight should movepublic final void move(IPeasant peasant, int direction)
peasant
- - The peasant to give the order todirection
- - The direction that the peasant should movepublic abstract void orderSubjects(int lastMoveTime)