40 lines
646 B
Java
40 lines
646 B
Java
package backend;
|
|
|
|
public class Move {
|
|
private int oldX,oldY,newX,newY; // starting and finishing coordinates of the move
|
|
private Piece pieceMoved;// the piece that has moved
|
|
|
|
|
|
public Move(int oldX, int oldY,int newX,int newY, Piece pieceMoved) {
|
|
this.oldX=oldX;
|
|
this.oldY=oldY;
|
|
this.newX=newX;
|
|
this.newY=newY;
|
|
this.pieceMoved=pieceMoved;
|
|
}
|
|
|
|
public int getOldX() {
|
|
return oldX;
|
|
|
|
}
|
|
|
|
public int getOldY() {
|
|
return oldY;
|
|
|
|
}
|
|
|
|
public int getNewX() {
|
|
return newX;
|
|
|
|
}
|
|
|
|
public int getNewY() {
|
|
return newY;
|
|
}
|
|
|
|
public Piece getPieceMoved() {
|
|
return pieceMoved;
|
|
|
|
}
|
|
}
|