|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectMove
public class Move
Constructor Summary | |
---|---|
Move(Board board)
Constructor |
Method Summary | |
---|---|
boolean |
canKingMove(int color)
Check if King can move. |
boolean |
checkSqValidity(java.lang.String sq)
Checks if the given notation is valid. |
boolean |
doMove(Player player,
java.lang.String srcSq,
java.lang.String destSq)
Move piece in selected square to destination square. |
HistoryOfMoves |
getHistoryOfMoves()
Returns history of all piece moves. |
boolean |
isPieceOnSquare(int x,
int y)
Returns true if the piece is found from the given location. |
boolean |
isPieceOnSquare(int x,
int y,
int color)
Returns true if piece with defined color is found from the given location. |
boolean |
isPieceOnSquare(java.lang.String notation)
Returns true if the piece is found from the given location. |
boolean |
isPieceOnSquare(java.lang.String notation,
int color)
Returns true if piece with defined color is found from the given location. |
java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> |
possiblePieceMoves(Piece piece)
Returns an arraylist containing two arraylists for possible coordinates the selected piece can move. |
void |
setHistoryOfMoves(HistoryOfMoves history)
Set history of all piece moves. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Move(Board board)
board
- Method Detail |
---|
public HistoryOfMoves getHistoryOfMoves()
public void setHistoryOfMoves(HistoryOfMoves history)
history
- public boolean doMove(Player player, java.lang.String srcSq, java.lang.String destSq)
player
- srcSq
- destSq
-
public boolean checkSqValidity(java.lang.String sq)
sq
-
public boolean isPieceOnSquare(int x, int y)
x
- y
-
public boolean isPieceOnSquare(java.lang.String notation)
notation
-
public boolean isPieceOnSquare(int x, int y, int color)
x
- y
- color
-
public boolean isPieceOnSquare(java.lang.String notation, int color)
notation
- color
-
public java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> possiblePieceMoves(Piece piece)
piece
-
public boolean canKingMove(int color)
color
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |