fix
This commit is contained in:
parent
139ae2c07d
commit
ce2f481729
|
|
@ -458,4 +458,5 @@ public class Board {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -107,4 +107,15 @@ public class Game extends Thread {
|
||||||
this.activationAIFlags[isWhite?1:0] = !this.activationAIFlags[isWhite?1:0];
|
this.activationAIFlags[isWhite?1:0] = !this.activationAIFlags[isWhite?1:0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*public static boolean isCheckmate(boolean b) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*public boolean isCheckmate() {
|
||||||
|
return board.isCheckmate();
|
||||||
|
}*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ public class JPanelChessBoard extends JPanel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g.setColor(Color.gray);
|
g.setColor(Color.black);
|
||||||
for(int x=0; x<myGame.getWidth();x++) {
|
for(int x=0; x<myGame.getWidth();x++) {
|
||||||
int graphX = Math.round(x*cellWidth);
|
int graphX = Math.round(x*cellWidth);
|
||||||
g.drawLine(graphX, 0, graphX, this.getHeight());
|
g.drawLine(graphX, 0, graphX, this.getHeight());
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package windowInterface;
|
package windowInterface;
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
|
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.GridLayout;
|
import java.awt.GridLayout;
|
||||||
|
|
||||||
|
|
@ -29,6 +30,8 @@ import javax.swing.AbstractListModel;
|
||||||
import javax.swing.JToggleButton;
|
import javax.swing.JToggleButton;
|
||||||
import javax.swing.JRadioButton;
|
import javax.swing.JRadioButton;
|
||||||
import javax.swing.JCheckBox;
|
import javax.swing.JCheckBox;
|
||||||
|
import backend.PieceType;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
|
||||||
public class MyInterface extends JFrame {
|
public class MyInterface extends JFrame {
|
||||||
|
|
||||||
|
|
@ -259,6 +262,11 @@ public class MyInterface extends JFrame {
|
||||||
actionLabel.setText(panelDraw.isPieceAdderMode()?"Adding Piece":
|
actionLabel.setText(panelDraw.isPieceAdderMode()?"Adding Piece":
|
||||||
(panelDraw.isPieceSelectorMode()?"Selecting Piece to Add":
|
(panelDraw.isPieceSelectorMode()?"Selecting Piece to Add":
|
||||||
"Playing"));
|
"Playing"));
|
||||||
|
/*if (game != null && game.isCheckmate(true)) {
|
||||||
|
String winner = turnIsWhite ? "Black" : "White"; // since it's mate, last move won
|
||||||
|
JOptionPane.showMessageDialog(this, "Checkmate! " + winner + " wins.", "Game Over", JOptionPane.INFORMATION_MESSAGE);
|
||||||
|
}*/
|
||||||
|
|
||||||
this.repaint();
|
this.repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -266,4 +274,7 @@ public class MyInterface extends JFrame {
|
||||||
this.setStepBanner("Turn : X");
|
this.setStepBanner("Turn : X");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue