Commit 43a94b5a authored by 9611046's avatar 9611046

Documentation

parent 72f9a332
...@@ -288,7 +288,7 @@ public class Main extends JFrame implements MouseListener { ...@@ -288,7 +288,7 @@ public class Main extends JFrame implements MouseListener {
inDanger = false; inDanger = false;
//Selecting a square //Selecting a square
if (!select) { if (!select) {
((Square) (e.getSource())).selectSquare(); ((Square) (e.getSource())).selectSquare();
} else { } else {
......
...@@ -13,10 +13,10 @@ public class Square extends JButton { ...@@ -13,10 +13,10 @@ public class Square extends JButton {
private int x; private int x;
private int y; private int y;
private Piece piece; private Piece piece;
private boolean isSelected = false; private boolean isSelected ;
private boolean hasPiece = false; private boolean hasPiece ;
private JLabel image; private JLabel image;
private boolean possibleSquare = false; private boolean possibleSquare ;
/** /**
* *
...@@ -26,7 +26,9 @@ public class Square extends JButton { ...@@ -26,7 +26,9 @@ public class Square extends JButton {
public Square(int x, int y){ public Square(int x, int y){
this.x=x; this.x=x;
this.y = y; this.y = y;
isSelected = false;
hasPiece = false;
possibleSquare = false;
} }
......
...@@ -266,8 +266,6 @@ public class King extends Piece { ...@@ -266,8 +266,6 @@ public class King extends Piece {
} }
public boolean isCheckMate(Square [][] squares){
return false;
}
} }
...@@ -72,8 +72,5 @@ public class Pawn extends Piece { ...@@ -72,8 +72,5 @@ public class Pawn extends Piece {
} }
// @Override
// public ArrayList<Square> move() {
// return null;
// }
} }
...@@ -14,10 +14,8 @@ private String pieceColor; ...@@ -14,10 +14,8 @@ private String pieceColor;
private String imagePath; private String imagePath;
//possibleSquares is protected in Piece class therefore subclasses have access to it
//for all subclasses used one arrayList and before using it in each class content will be cleared
private ArrayList<Square> possibleSquares = new ArrayList<>();
...@@ -50,5 +48,4 @@ private ArrayList<Square> possibleSquares = new ArrayList<>(); ...@@ -50,5 +48,4 @@ private ArrayList<Square> possibleSquares = new ArrayList<>();
public abstract ArrayList<Square> move(Square[][] boardSquares, int x, int y); public abstract ArrayList<Square> move(Square[][] boardSquares, int x, int y);
// public abstract ArrayList<Square> move();
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment