You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
726 B

11 months ago
public class Move {
//source and dest coordinates
11 months ago
int startIndex;
int destIndex;
public Move(int startIndex, int destIndex) {
this.startIndex = startIndex;
this.destIndex = destIndex;
}
11 months ago
11 months ago
public Move(int sourceRow, int sourceColumn, int destinationRow, int destinationColumn) {
11 months ago
//TODO
}
public int getSourceRow() {
return startIndex / 12 - 2;
}
public int getSourceCol() {
return startIndex % 12 - 2;
}
public int getDestRow() {
return destIndex / 12 - 2;
}
public int getDestCol() {
return destIndex % 12 - 2;
11 months ago
}
11 months ago
//returns something like e2-e4 or Qc8++
public String toString() {
11 months ago
return "("+getSourceRow()+","+getSourceCol() + ") -> " + "("+getDestRow()+","+getDestCol() + ")";
11 months ago
}
}