Skip to content

Commit

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

/**
* Relative Fork Evaluation
*
* A fork is a tactic in which a piece attacks multiple pieces at the same time.
* It is a double attack. A fork not involving the enemy king is a relative
* fork.
*/
class RelativeForkEval extends AbstractEval implements
ElaborateEvalInterface,
ExplainEvalInterface
{
use ElaborateEvalTrait;
use ExplainEvalTrait;

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

/**
* @param \Chess\Variant\AbstractBoard $board
*/
public function __construct(AbstractBoard $board)
{
$this->board = $board;
Expand Down Expand Up @@ -52,6 +67,11 @@ public function __construct(AbstractBoard $board)
$this->explain($this->result);
}

/**
* 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 a5c49d8

Please sign in to comment.