added a class that could be implemented with more work and time.
This commit is contained in:
parent
a3e65fcb81
commit
efd5d21f19
|
|
@ -13,7 +13,6 @@ public class Main {
|
|||
Board testBoard = new Board(8, 8);
|
||||
testBoard.populateBoard();
|
||||
System.out.println(testBoard.toString());
|
||||
|
||||
// launches graphical interface :
|
||||
MyInterface mjf = new MyInterface();
|
||||
mjf.setVisible(true);
|
||||
|
|
|
|||
|
|
@ -11,6 +11,9 @@ public class Board {
|
|||
Piece selectedCell;
|
||||
private ArrayList<Move> moveHistory = new ArrayList<>();
|
||||
public Piece enPassantTargetPawn = null;
|
||||
public Interface Color;
|
||||
|
||||
|
||||
|
||||
int turnNumber = 0;
|
||||
|
||||
|
|
@ -20,6 +23,7 @@ public class Board {
|
|||
lNum=lineNum;
|
||||
cells = new Piece[cNum][lNum]; // creation du tableau de pieces
|
||||
selectedCell=null;
|
||||
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
|
|
@ -34,7 +38,6 @@ public class Board {
|
|||
return turnNumber;
|
||||
}
|
||||
|
||||
|
||||
public boolean isTurnWhite() {
|
||||
return getTurnNumber() % 2 == 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import javax.swing.JPanel;
|
|||
import backend.Game;
|
||||
import backend.Piece;
|
||||
import backend.PieceType;
|
||||
import backend.Interface;
|
||||
|
||||
public class JPanelChessBoard extends JPanel {
|
||||
|
||||
|
|
@ -31,6 +32,9 @@ public class JPanelChessBoard extends JPanel {
|
|||
private boolean selectedPieceIsWhite;
|
||||
private PieceType selectedPieceType;
|
||||
private boolean pieceAdderMode;
|
||||
private Interface color;
|
||||
|
||||
|
||||
|
||||
public JPanelChessBoard(MyInterface itf) {
|
||||
super();
|
||||
|
|
@ -81,7 +85,7 @@ public class JPanelChessBoard extends JPanel {
|
|||
@Override
|
||||
protected void paintComponent(Graphics g) {
|
||||
super.paintComponent(g);
|
||||
this.setBackground(Color.PINK);
|
||||
this.setBackground(Color.DARK_GRAY);
|
||||
if(pieceSelectorMode) {
|
||||
g.drawImage(
|
||||
spriteSheet,
|
||||
|
|
|
|||
Loading…
Reference in New Issue