java.lang.Objectedu.gwu.champAlg.ChessMove
public class ChessMove
Use an instance of ChessMove to describe a move.
Remember that standard x,y coordinates are used:
x goes left to right, y bottom to top. And board[x][y] is of type char.
NOTE: currently en-passant is not implemented.
| Field Summary | |
|---|---|
java.lang.String |
annotation
Used by the rule-engine. |
int |
fromX
Current x location of the piece you want to move. |
int |
fromY
Current y location of the piece you want to move. |
boolean |
isEnPassant
Not currently implemented. |
boolean |
isKillMove
Used by the rule-engine. |
boolean |
isKingSideCastle
Set this to true if you want to do a king-side castle. |
boolean |
isPawnToQueen
Set this to true to queen a pawn. |
boolean |
isQueenSideCastle
Set this to true if you want to do a queen-side castle. |
int |
toX
Desired x location of the piece you want to move. |
int |
toY
Desired x location of the piece you want to move. |
| Constructor Summary | |
|---|---|
ChessMove(int fromX,
int fromY,
int toX,
int toY)
Use this constructor to create a new ChessMove instance. |
|
ChessMove(int fromX,
int fromY,
int toX,
int toY,
java.lang.String annot)
|
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public int fromX
public int fromY
public int toX
public int toY
public boolean isKingSideCastle
public boolean isQueenSideCastle
public boolean isPawnToQueen
public boolean isKillMove
public boolean isEnPassant
public java.lang.String annotation
| Constructor Detail |
|---|
public ChessMove(int fromX,
int fromY,
int toX,
int toY)
ChessMove instance.
fromX - an int valuefromY - an int valuetoX - an int valuetoY - an int value
public ChessMove(int fromX,
int fromY,
int toX,
int toY,
java.lang.String annot)
| Method Detail |
|---|
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object