-
Notifications
You must be signed in to change notification settings - Fork 0
/
Queen.java
43 lines (32 loc) · 941 Bytes
/
Queen.java
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
package a1;
import java.util.ArrayList;
public class Queen extends ChessPiece{
private static final String whiteQueen = "\u2655";
private static final String blackQueen = "\u265B";
/*
* Constructor to initialize ChessPiece with a board and Color
*/
public Queen(ChessBoard board, Color color) {
super(board, color);
}
/*
* Returns the string for unicode White Queen and Black Queen
*/
public String toString() {
if(getColor() == Color.WHITE)
return whiteQueen.toString();
else if(getColor() == Color.BLACK)
return blackQueen.toString();
else
return null;
}
/*
* Returns an ArrayList for the legalMoves Queen can make from the current position
* Returns an empty ArrayList if no legal moves available.
* Queen cannot move in this game no no legal moves.
*/
public ArrayList<String> legalMoves(){
ArrayList<String> queenMoves = new ArrayList<>();
return queenMoves;
}
}