|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrules.Move
public final class Move
Myriad's representation of chess moves, each chess move consists of a starting square an ending square and an appropriate modifier. Once a Move object has been instantiated it cannot be changed!
Field Summary | |
---|---|
static Move[] |
CASTLE
A constant array storing all special castling moves. |
Constructor Summary | |
---|---|
Move(byte startsq,
byte endsq)
Makes a "normal" move with no special modifier. |
|
Move(byte startsq,
byte endsq,
byte modifier)
Makes a special move that requires a start, destination, and a modifier. |
Method Summary | |
---|---|
byte |
getEndSquare()
Gets the ending square of this move object. |
byte |
getModifier()
Gets the modifier stored in this move. |
byte |
getStartSquare()
Gets the starting square of this move object. |
boolean |
isEqual(Move m)
Checks whether another move object is the same as the given move object. |
static byte |
stringTo0x88(java.lang.String sq)
|
static Move |
toMove(java.lang.String m_s)
|
java.lang.String |
toString()
Returns a string describing this move. |
java.lang.String |
toString(Position p)
Converts the move object into expanded algebraic notation. |
static java.lang.String |
x88ToString(byte sq)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Move[] CASTLE
Constructor Detail |
---|
public Move(byte startsq, byte endsq)
startsq
- The starting square.endsq
- The destination square.public Move(byte startsq, byte endsq, byte modifier)
startsq
- The starting square.endsq
- The ending square.modifier
- Modifiers: 0 = no modifier, 5 = en passant, 6 = promote to rook,
7 = promote to knight, 8 = promote to bishop, 9 = promote to queen.Method Detail |
---|
public boolean isEqual(Move m)
m
- Another move object.
public byte getStartSquare()
public byte getEndSquare()
public byte getModifier()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(Position p)
p
- The current position, used to convert into expanded algebraic notation.
public static Move toMove(java.lang.String m_s)
public static byte stringTo0x88(java.lang.String sq)
public static java.lang.String x88ToString(byte sq)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |