-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPiece.java
More file actions
31 lines (26 loc) · 704 Bytes
/
Copy pathPiece.java
File metadata and controls
31 lines (26 loc) · 704 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
* Piece.java
*
* @author Deep Patel
*
* REMARKS: This is an abstract class to store the different types of chess pieces
* and the information needed by all the pieces
*/
public abstract class Piece {
//Instance variable
private boolean myPiece = false;
//Constructor
public Piece(boolean piece){
myPiece = piece;
}
//Return which team the piece belongs to (AI or player)
public boolean getWhosePiece(){
return myPiece;
}
//Set who a piece belongs to
public void setWhosePiece(boolean piece){
piece = myPiece;
}
//Method to check if a pieces move is valid
public abstract boolean isValidMove(Board board, Move move);
}