-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMove.java
More file actions
28 lines (24 loc) · 882 Bytes
/
Move.java
File metadata and controls
28 lines (24 loc) · 882 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
public class Move{
final Coordinates origin;
final Coordinates destination;
final Piece pieceAtOrigin;
final Piece pieceAtDestination;
public Move(Board board, Coordinates origin, Coordinates destination){
this.origin = origin;
this.destination = destination;
this.pieceAtOrigin = board.getPiece(origin);
this.pieceAtDestination = board.getPiece(destination);
}
public Move(Coordinates origin, Coordinates destination, Piece pieceAtOrigin, Piece pieceAtDestination){
this.origin = origin;
this.destination = destination;
this.pieceAtOrigin = pieceAtOrigin;
this.pieceAtDestination = pieceAtDestination;
}
public Move(Board board, FromTo ft){
this.origin = ft.getFrom();
this.destination = ft.getTo();
this.pieceAtOrigin = board.getPiece(ft.getFrom());
this.pieceAtDestination = board.getPiece(ft.getTo());
}
}