Methods Summary |
---|
public void | assign(int file, int rank, int piece, int clr)
pieceValue.assign(file,rank,piece);
pieceColor.assign(file,rank,clr);
|
public void | copy(borland.samples.apps.chess.client.MoveNode from)
this.pieceColor.init(from.pieceColor);
this.pieceValue.init(from.pieceValue);
for (int i = 0;i < 2;i++) {
this.qCastleForfeited[i] = from.qCastleForfeited[i];
this.kCastleForfeited[i] = from.kCastleForfeited[i];
}
this.enpassantFile = from.enpassantFile;
|
public boolean | equals(borland.samples.apps.chess.client.MoveNode x)
if (pieceColor.equals(x.pieceColor) &&
pieceValue.equals(x.pieceValue) &&
qCastleForfeited[0] == x.qCastleForfeited[0] &&
kCastleForfeited[0] == x.kCastleForfeited[0] &&
qCastleForfeited[1] == x.qCastleForfeited[1] &&
kCastleForfeited[1] == x.kCastleForfeited[1] &&
enpassantFile < 0 &&
x.enpassantFile < 0 )
return true;
else
return false;
|
public boolean | matchingPawnSkeleton(borland.samples.apps.chess.client.MoveNode x)
int ourSquare;
int theirSquare;
for (int file = 0;file < 8;file++)
for (int rank = 0;rank < 8;rank++) {
ourSquare = pieceValue.value(file,rank);
theirSquare = x.pieceValue.value(file,rank);
if (ourSquare == theirSquare);
else
if (ourSquare == Chessboard.PAWN ||
theirSquare == Chessboard.PAWN)
return false;
}
return true;
|
public int | pieceCount()
return pieceValue.nonZeroElementCount();
|
public int | pieceValues(int Color)
int sum = 0;
for (int column=0;column<8;column++)
for (int row=0;row<8;row++)
if (pieceColor.value(column,row) == Color)
sum = sum + pieceValue.value(column,row);
return sum;
|