edu.gwu.champAlg
Class ChessMove

java.lang.Object
  extended by edu.gwu.champAlg.ChessMove

public class ChessMove
extends java.lang.Object

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

fromX

public int fromX
Current x location of the piece you want to move.


fromY

public int fromY
Current y location of the piece you want to move.


toX

public int toX
Desired x location of the piece you want to move.


toY

public int toY
Desired x location of the piece you want to move.


isKingSideCastle

public boolean isKingSideCastle
Set this to true if you want to do a king-side castle.


isQueenSideCastle

public boolean isQueenSideCastle
Set this to true if you want to do a queen-side castle.


isPawnToQueen

public boolean isPawnToQueen
Set this to true to queen a pawn. Currently, the only option is a queen (knight not allowed).


isKillMove

public boolean isKillMove
Used by the rule-engine.


isEnPassant

public boolean isEnPassant
Not currently implemented.


annotation

public java.lang.String annotation
Used by the rule-engine.

Constructor Detail

ChessMove

public ChessMove(int fromX,
                 int fromY,
                 int toX,
                 int toY)
Use this constructor to create a new ChessMove instance.

Parameters:
fromX - an int value
fromY - an int value
toX - an int value
toY - an int value

ChessMove

public ChessMove(int fromX,
                 int fromY,
                 int toX,
                 int toY,
                 java.lang.String annot)
Method Detail

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object