Skip to content

Commit a5c49d8

Browse files
author
programarivm
committed
Documented RelativeForkEval
1 parent 39f03d5 commit a5c49d8

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/Eval/RelativeForkEval.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,30 @@
77
use Chess\Variant\AbstractPiece;
88
use Chess\Variant\Classical\PGN\AN\Piece;
99

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+
*/
1017
class RelativeForkEval extends AbstractEval implements
1118
ElaborateEvalInterface,
1219
ExplainEvalInterface
1320
{
1421
use ElaborateEvalTrait;
1522
use ExplainEvalTrait;
1623

24+
/**
25+
* The name of the heuristic.
26+
*
27+
* @var string
28+
*/
1729
const NAME = 'Relative fork';
1830

31+
/**
32+
* @param \Chess\Variant\AbstractBoard $board
33+
*/
1934
public function __construct(AbstractBoard $board)
2035
{
2136
$this->board = $board;
@@ -52,6 +67,11 @@ public function __construct(AbstractBoard $board)
5267
$this->explain($this->result);
5368
}
5469

70+
/**
71+
* Elaborate on the evaluation.
72+
*
73+
* @param \Chess\Variant\AbstractPiece $piece
74+
*/
5575
private function elaborate(AbstractPiece $piece): void
5676
{
5777
$phrase = PiecePhrase::create($piece);

0 commit comments

Comments
 (0)