Added blind mode
This commit is contained in:
parent
346acb8bc8
commit
1b2458fc14
|
@ -62,6 +62,8 @@ public class Chessboard extends JPanel {
|
|||
|
||||
private Player activePlayer;
|
||||
|
||||
public boolean blindMode = false;
|
||||
|
||||
/**
|
||||
* Constructor of the chessboard
|
||||
*/
|
||||
|
@ -157,6 +159,7 @@ public class Chessboard extends JPanel {
|
|||
for (int y = 0; y < pieces.length; y++) {
|
||||
for (int x = 0; x < pieces[y].length; x++) {
|
||||
if(pieces[y][x] != null && !pieces[y][x].isFloating()) {
|
||||
if(blindMode && pieces[y][x].getPlayer() != activePlayer) continue;
|
||||
double xOffset = pieceOffset + SQUARE_SIZE*x;
|
||||
double yOffset = pieceOffset + SQUARE_SIZE*y;
|
||||
g2.translate(xOffset, yOffset);
|
||||
|
|
Loading…
Reference in a new issue