Skip to content

Commit

Permalink
Documented AbsoluteForkEval (chesslablab#633)
Browse files Browse the repository at this point in the history
  • Loading branch information
programarivm authored Oct 15, 2024
1 parent 7805e08 commit 39f03d5
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/Eval/AbsoluteForkEval.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,27 @@
use Chess\Variant\AbstractPiece;
use Chess\Variant\Classical\PGN\AN\Piece;

/**
* Absolute Fork Evaluation
*
* A fork is a tactic in which a piece attacks multiple enemy pieces
* simultaneously. A fork is a type of double attack. If the king is one of the
* attacked pieces, the term absolute fork is then used.
*/
class AbsoluteForkEval extends AbstractEval implements ElaborateEvalInterface
{
use ElaborateEvalTrait;

/**
* The name of the heuristic.
*
* @var string
*/
const NAME = 'Absolute fork';

/**
* @param \Chess\Variant\AbstractBoard $board
*/
public function __construct(AbstractBoard $board)
{
$this->board = $board;
Expand All @@ -31,6 +46,11 @@ public function __construct(AbstractBoard $board)
}
}

/**
* Elaborate on the evaluation.
*
* @param \Chess\Variant\AbstractPiece $piece
*/
private function elaborate(AbstractPiece $piece): void
{
$phrase = PiecePhrase::create($piece);
Expand Down

0 comments on commit 39f03d5

Please sign in to comment.