-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMoveBuilder.java
More file actions
85 lines (68 loc) · 2.26 KB
/
MoveBuilder.java
File metadata and controls
85 lines (68 loc) · 2.26 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
public class MoveBuilder {
private byte _startSquare;
private byte _targetSquare;
private byte _thisPieceType;
private byte _capturedPieceType;
private byte _capturedPieceSquare;
private boolean _enPassant = false;
private boolean _castleLeft = false;
private boolean _castleRight = false;
private boolean _promotion = false;
private boolean _firstMove = false;
private boolean _check = false;
private double _captureValue = 0;
public MoveBuilder() {
}
public Move buildMove() {
return new Move(_startSquare, _targetSquare, _thisPieceType, _capturedPieceSquare, _capturedPieceType,
_enPassant, _castleLeft, _castleRight, _promotion, _firstMove, _check, _captureValue);
}
public MoveBuilder startSquare(byte _startSquare) {
this._startSquare = _startSquare;
return this;
}
public MoveBuilder targetSquare(byte _targetSquare) {
this._targetSquare = _targetSquare;
return this;
}
public MoveBuilder thisPieceType(byte _thisPieceType) {
this._thisPieceType = _thisPieceType;
return this;
}
public MoveBuilder capturedPieceSquare(byte _capturedPieceSquare) {
this._capturedPieceSquare = _capturedPieceSquare;
return this;
}
public MoveBuilder capturedPieceType(byte _capturedPieceType) {
this._capturedPieceType = _capturedPieceType;
return this;
}
public MoveBuilder enPassant(boolean _enPassant) {
this._enPassant = _enPassant;
return this;
}
public MoveBuilder castleLeft(boolean _castleLeft) {
this._castleLeft = _castleLeft;
return this;
}
public MoveBuilder castleRight(boolean _castleRight) {
this._castleRight = _castleRight;
return this;
}
public MoveBuilder promotion(boolean _promotion) {
this._promotion = _promotion;
return this;
}
public MoveBuilder firstMove(boolean _firstMove) {
this._firstMove = _firstMove;
return this;
}
public MoveBuilder check(boolean _check) {
this._check = _check;
return this;
}
public MoveBuilder captureValue(double _captureValue) {
this._captureValue = _captureValue;
return this;
}
}