Changed design in controller
parent
6374c206de
commit
e6e1fa3187
|
|
@ -86,7 +86,7 @@ public class Controller {
|
||||||
|
|
||||||
selectedRow = modelRow;
|
selectedRow = modelRow;
|
||||||
selectedCol = modelCol;
|
selectedCol = modelCol;
|
||||||
gui.getField(guiRow, guiCol).setBorder(BorderFactory.createLineBorder(Color.RED, 2));
|
gui.getField(guiRow, guiCol).setBorder(BorderFactory.createLineBorder(new Color(0x1b263b), 7));
|
||||||
|
|
||||||
String fromSquare = coordToChessNotation(modelRow, modelCol);
|
String fromSquare = coordToChessNotation(modelRow, modelCol);
|
||||||
List<MoveDTO> moves = engine.getLegalDestinations(fromSquare);
|
List<MoveDTO> moves = engine.getLegalDestinations(fromSquare);
|
||||||
|
|
@ -94,7 +94,7 @@ public class Controller {
|
||||||
for (MoveDTO move : moves) {
|
for (MoveDTO move : moves) {
|
||||||
int guiToRow = gui.isFlipped() ? 7 - move.getToRow() : move.getToRow();
|
int guiToRow = gui.isFlipped() ? 7 - move.getToRow() : move.getToRow();
|
||||||
int guiToCol = gui.isFlipped() ? 7 - move.getToCol() : move.getToCol();
|
int guiToCol = gui.isFlipped() ? 7 - move.getToCol() : move.getToCol();
|
||||||
gui.getField(guiToRow, guiToCol).setBackground(Color.YELLOW);
|
gui.getField(guiToRow, guiToCol).setBackground(new Color( 27, 38, 59 ));
|
||||||
highlightedFields.add(new int[]{guiToRow, guiToCol});
|
highlightedFields.add(new int[]{guiToRow, guiToCol});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -113,9 +113,6 @@ public class Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void handleMove(MoveDTO move) {
|
public void handleMove(MoveDTO move) {
|
||||||
if (engine.move(move)) {
|
if (engine.move(move)) {
|
||||||
updateGuiBoard();
|
updateGuiBoard();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue