|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectsuicideChess.Move
This class is used for moves representation.
| Nested Class Summary | |
class |
Move.NotAValidMoveException
|
| Constructor Summary | |
Move(java.lang.String move,
Board board)
This is the constructor of the class. |
|
| Method Summary | |
void |
display()
Displays a move in great details. |
suicideChess.Square |
fromSquare()
Returns the Square to move from in a Move |
suicideChess.Piece |
getCapturedPiece()
Returns the Piece to be captured in a Move |
suicideChess.Piece |
getMovingPiece()
Returns the moving piece of a Move. |
suicideChess.Piece |
getPromotionPiece()
Returns the promotion Piece of a Move |
boolean |
isCaptureMove()
Returns a boolean saying if a Move is a capture move |
boolean |
isPromotionMove()
Returns a boolean saying if a Move is a promotion or not. |
suicideChess.Square |
toSquare()
Returns the Square to move to in a Move |
java.lang.String |
toString()
Converts a Move into a String. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Move(java.lang.String move,
Board board)
throws Move.NotAValidMoveException,
suicideChess.Square.NotAValidSquare
move - A String containing of type "e2e4" (4 chars), "b7b8q" (5 chars) for promotions.
It is the standard algebraic notation used for chess.board - A Board to be able to locate the pieces.
Move.NotAValidMoveException - When the String is not legal (too long or too short).
NotAValidSquare - It the String is not legal (not standard algebraic notation).
suicideChess.Square.NotAValidSquareBoard| Method Detail |
public suicideChess.Square fromSquare()
Square to move from in a Move
Squarepublic suicideChess.Square toSquare()
Square to move to in a Move
Squarepublic boolean isPromotionMove()
public suicideChess.Piece getPromotionPiece()
Piece of a Move
Piecepublic suicideChess.Piece getMovingPiece()
piece of a Move.
Piecepublic boolean isCaptureMove()
public suicideChess.Piece getCapturedPiece()
Piece to be captured in a Move
public java.lang.String toString()
public void display()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||