Class MyRuler

java.lang.Object
  |
  +--com.ibm.ruler.Ruler
        |
        +--MyRuler
All Implemented Interfaces:
IRuler

public class MyRuler
extends Ruler

This is the class that you must implement to enable your ruler within the CodeRuler environment. Adding code to these methods will give your ruler its personality and allow it to compete.


Field Summary
 
Fields inherited from class com.ibm.ruler.Ruler
MOVE_E, MOVE_N, MOVE_NE, MOVE_NONE, MOVE_NW, MOVE_S, MOVE_SE, MOVE_SW, MOVE_W
 
Method Summary
 java.lang.String getRulerName()
          Return the name of your ruler.
 java.lang.String getSchoolName()
          Return the name of your school.
 void initialize()
          Called to give you a chance to do initialization.
 void orderSubjects(int lastMoveTime)
          This method is called each turn to allow you to give orders to your peasants, knights, and castles.
 
Methods inherited from class com.ibm.ruler.Ruler
capture, createKnights, createPeasants, getCastles, getKnights, getOwnedLandCount, getPeasants, getPoints, move, move

Method Detail

getRulerName

public java.lang.String getRulerName()
Description copied from class: Ruler
Return the name of your ruler. This method will only be called once during initialization.

Specified by:
getRulerName in interface IRuler
Specified by:
getRulerName in class Ruler
Returns:
java.lang.String

getSchoolName

public java.lang.String getSchoolName()
Description copied from class: Ruler
Return the name of your school. This method will only be called once during initialization.

Specified by:
getSchoolName in interface IRuler
Specified by:
getSchoolName in class Ruler
Returns:
java.lang.String

initialize

public void initialize()
Description copied from class: Ruler
Called to give you a chance to do initialization. This method will be called at the beginning of each match, and you will have a limited amount of time to do initialization. All of your objects and your opponents' objects will already exist.

Specified by:
initialize in class Ruler

orderSubjects

public void orderSubjects(int lastMoveTime)
Description copied from class: Ruler
This method is called each turn to allow you to give orders to your peasants, knights, and castles. The parameter specifies the length of time (in ms) that the last call to orderSubjects() took. (The first time that this method is called, lastMoveTime is -1)

Specified by:
orderSubjects in class Ruler