-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPiece.java
More file actions
44 lines (29 loc) · 827 Bytes
/
Copy pathPiece.java
File metadata and controls
44 lines (29 loc) · 827 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
32
33
34
35
36
37
38
39
40
41
42
43
44
package chess;
public abstract class Piece extends MoveAbstractClass{
// What features does EVERY piece share??
protected char file;
protected int rank;
protected boolean isBlack;
public Piece (char pieceFile, int pieceRank, boolean isBlack) {
this.file = pieceFile;
this.rank = pieceRank;
this.isBlack = isBlack;
}
public char getFile() {
return file;
}
public int getRank() {
return rank;
}
public boolean getIsBlack() {
return isBlack;
}
public void setNewPosition(char file, int rank) {
this.file = file;
this.rank = rank;
}
@Override
public abstract boolean canMove(char startFile, int startRank, char newFile, int newRank, Board board);
public abstract Piece clone();
public abstract String getSymbol();
}