-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathPiece.java
More file actions
33 lines (30 loc) · 1.18 KB
/
Copy pathPiece.java
File metadata and controls
33 lines (30 loc) · 1.18 KB
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
//package myrmidonChess;
import java.util.ArrayList;
/*(Jeff, Shen wei)*/
public abstract class Piece {
//private String type;
//private String color;
public abstract String getType();
public abstract void setType(String type);
public abstract String getColor();
public abstract void setColor(String color);
public abstract ArrayList<Integer> showMove(Piece[][] pieceManager, int r, int c);
public static void transform(Piece[][] pieceManager, int turn) {
int counter = turn;
if(counter != 0 && counter % 6 == 0) {
for(int x = 0; x < Board.ROWS; x++) {
for(int y = 0; y < Board.COLUMNS; y++) {
if (pieceManager[x][y].getType() == "Triangle") {
pieceManager[x][y] = new Chevron(pieceManager[x][y].getColor());
} else if (pieceManager[x][y].getType() == "Chevron") {
pieceManager[x][y] = new Plus(pieceManager[x][y].getColor());
} else if (pieceManager[x][y].getType() == "Plus") {
pieceManager[x][y] = new Triangle(pieceManager[x][y].getColor());
} else {
// do nothing
}
}
}
}
}
}