Methods Summary |
---|
public int | getAttacker()
return attacker;
|
public int | getAttackerFile()
return attackerFile;
|
public int | getAttackerRank()
return attackerRank;
|
public int | getKingColor()
return kingColor;
|
public int | getKingFile()
return kingFile;
|
public int | getKingRank()
return kingRank;
|
public boolean | isDoubleCheck()
return (kingCheckCount > 1) ;
|
public boolean | isInCheck()
return (kingCheckCount != 0);
|
public void | kingInCheck(boolean b)
if (b)
kingCheckCount++;
else {
// System.out.println("no attacker");
attacker = -1;
attackerRank = -1;
attackerFile = -1;
kingCheckCount = 0;
}
|
public boolean | kingPosEquals(int file, int rank)
if (rank == kingRank && file == kingFile)
return true;
else
return false;
|
public void | setAttacker(int piecevalue, int file, int rank)
if (piecevalue < 0) {
System.out.println("no attacker");
attacker = -1;
attackerRank = -1;
attackerFile = -1;
kingCheckCount = 0;
}
else {
System.out.println("found attacker" + piecevalue + file + rank);
attacker = piecevalue;
attackerRank = rank;
attackerFile = file;
kingCheckCount++;
}
|
public void | setKingPos(int file, int rank)
if (rank >= 0)
kingRank = rank;
if (file >= 0)
kingFile = file;
//System.out.println("King Pos = " + file + rank + " (" + kingColor);
|