-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMove.java
More file actions
61 lines (52 loc) · 1.99 KB
/
Move.java
File metadata and controls
61 lines (52 loc) · 1.99 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package chessprj;
/**********************************************************************
* Data Structure for Movement
**********************************************************************/
public class Move {
/** to and from row and columns */
public int fromRow, fromColumn, toRow, toColumn;
public int moveValue;
/**********************************************************************
* Empty alternate constructor
**********************************************************************/
public Move() {
}
/**********************************************************************
* Constructor for Move class
*
* @param fromRow
* @param fromColumn
* @param toRow
* @param toColumn
**********************************************************************/
public Move(int fromRow, int fromColumn, int toRow, int toColumn) {
this.fromRow = fromRow;
this.fromColumn = fromColumn;
this.toRow = toRow;
this.toColumn = toColumn;
}
/**********************************************************************
* Setter for MoveValue
*
* @param v
**********************************************************************/
public void setMoveValue(int v){
moveValue = v;
}
/**********************************************************************
* Getter for MoveValue
*
* @return moveValue
**********************************************************************/
public int getMoveValue(){
return moveValue;
}
/**********************************************************************
* toString for Move class
**********************************************************************/
@Override
public String toString() {
return "Move [fromRow=" + fromRow + ", fromColumn=" + fromColumn + ", toRow=" + toRow + ", toColumn=" + toColumn
+ "]";
}
}