Fixed some Javadoc and formatting

This commit is contained in:
Kai S. K. Engelbart 2019-12-21 21:42:36 +01:00
parent b6dd75b979
commit cb4f44539a
2 changed files with 14 additions and 15 deletions

View File

@ -30,11 +30,13 @@ public class Board {
/** /**
* Creates a copy of another {@link Board} instance.<br> * Creates a copy of another {@link Board} instance.<br>
* The created object is a deep copy, but does not contain any move history * The created object is a deep copy, and can optionally contain the move
* apart from the current {@link MoveNode}. * history of the Board to copy.
* *
* @param other The {@link Board} instance to copy * @param other The Board instance to copy
* @param copyVariations TODO * @param copyVariations if set to {@code true}, the {@link Log} object of the
* other Board instance is copied with its entire move
* history
*/ */
public Board(Board other, boolean copyVariations) { public Board(Board other, boolean copyVariations) {
for (int i = 0; i < 8; i++) for (int i = 0; i < 8; i++)
@ -99,9 +101,7 @@ public class Board {
* *
* @param sanMove The move to execute in SAN (Standard Algebraic Notation) * @param sanMove The move to execute in SAN (Standard Algebraic Notation)
*/ */
public void move(String sanMove) { public void move(String sanMove) { move(Move.fromSAN(sanMove, this)); }
move(Move.fromSAN(sanMove, this));
}
/** /**
* Reverts the last move and removes it from the log. * Reverts the last move and removes it from the log.

View File

@ -31,7 +31,7 @@ import dev.kske.chess.game.NaturalPlayer;
* Project: <strong>Chess</strong><br> * Project: <strong>Chess</strong><br>
* File: <strong>GamePane.java</strong><br> * File: <strong>GamePane.java</strong><br>
* Created: <strong>23.08.2019</strong><br> * Created: <strong>23.08.2019</strong><br>
* *
* @since Chess v0.4-alpha * @since Chess v0.4-alpha
* @author Kai S. K. Engelbart * @author Kai S. K. Engelbart
*/ */
@ -44,9 +44,7 @@ public class GamePane extends JComponent {
private Game game; private Game game;
private Color activeColor; private Color activeColor;
private JPanel moveSelectionPanel; private JPanel moveSelectionPanel;
private JButton btnNext; private JButton btnFirst, btnPrevious, btnNext, btnLast;
private JButton btnFirst;
private JButton btnLast;
public GamePane() { public GamePane() {
activeColor = Color.WHITE; activeColor = Color.WHITE;
@ -96,9 +94,9 @@ public class GamePane extends JComponent {
btnFirst.setEnabled(false); btnFirst.setEnabled(false);
moveSelectionPanel.add(btnFirst); moveSelectionPanel.add(btnFirst);
JButton btnPreviousMove = new JButton("Previous"); btnPrevious = new JButton("Previous");
btnPreviousMove.setEnabled(false); btnPrevious.setEnabled(false);
moveSelectionPanel.add(btnPreviousMove); moveSelectionPanel.add(btnPrevious);
btnNext = new JButton("Next"); btnNext = new JButton("Next");
btnNext.setEnabled(false); btnNext.setEnabled(false);
@ -107,6 +105,7 @@ public class GamePane extends JComponent {
btnLast = new JButton("Last"); btnLast = new JButton("Last");
btnLast.setEnabled(false); btnLast.setEnabled(false);
moveSelectionPanel.add(btnLast); moveSelectionPanel.add(btnLast);
boardPane = new BoardPane(); boardPane = new BoardPane();
GridBagConstraints gbc_boardPane = new GridBagConstraints(); GridBagConstraints gbc_boardPane = new GridBagConstraints();
gbc_boardPane.fill = GridBagConstraints.BOTH; gbc_boardPane.fill = GridBagConstraints.BOTH;
@ -189,7 +188,7 @@ public class GamePane extends JComponent {
/** /**
* Assigns a new {@link Game} instance to this game pane. If exactly one of the * Assigns a new {@link Game} instance to this game pane. If exactly one of the
* players is natural, color swapping functionality is enabled. * players is natural, color swapping functionality is enabled.
* *
* @param game The {@link Game} to assign to this game pane. * @param game The {@link Game} to assign to this game pane.
*/ */
public void setGame(Game game) { public void setGame(Game game) {