File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 7
7
use Chess \Variant \AbstractPiece ;
8
8
use Chess \Variant \Classical \PGN \AN \Piece ;
9
9
10
+ /**
11
+ * Relative Fork Evaluation
12
+ *
13
+ * A fork is a tactic in which a piece attacks multiple pieces at the same time.
14
+ * It is a double attack. A fork not involving the enemy king is a relative
15
+ * fork.
16
+ */
10
17
class RelativeForkEval extends AbstractEval implements
11
18
ElaborateEvalInterface,
12
19
ExplainEvalInterface
13
20
{
14
21
use ElaborateEvalTrait;
15
22
use ExplainEvalTrait;
16
23
24
+ /**
25
+ * The name of the heuristic.
26
+ *
27
+ * @var string
28
+ */
17
29
const NAME = 'Relative fork ' ;
18
30
31
+ /**
32
+ * @param \Chess\Variant\AbstractBoard $board
33
+ */
19
34
public function __construct (AbstractBoard $ board )
20
35
{
21
36
$ this ->board = $ board ;
@@ -52,6 +67,11 @@ public function __construct(AbstractBoard $board)
52
67
$ this ->explain ($ this ->result );
53
68
}
54
69
70
+ /**
71
+ * Elaborate on the evaluation.
72
+ *
73
+ * @param \Chess\Variant\AbstractPiece $piece
74
+ */
55
75
private function elaborate (AbstractPiece $ piece ): void
56
76
{
57
77
$ phrase = PiecePhrase::create ($ piece );
You can’t perform that action at this time.
0 commit comments