Skip to content

Commit

Permalink
Updated to PHP Chess 1.4.17
Browse files Browse the repository at this point in the history
  • Loading branch information
programarivm committed Apr 19, 2024
1 parent 3ca712b commit 8ee6901
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/Command/StartCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace ChessServer\Command;

use Chess\FenToBoard;
use Chess\FenToBoardFactory;
use Chess\Play\SanPlay;
use Chess\Variant\Capablanca\Board as CapablancaBoard;
use Chess\Variant\Capablanca\FEN\StrToBoard as CapablancaFenStrToBoard;
Expand Down Expand Up @@ -158,26 +158,26 @@ public function run(ChesslaBlabSocket $socket, array $argv, int $id)
$startPos = str_split($settings->startPos);
$board = new Chess960Board($startPos);
if (isset($settings->fen)) {
$board = FenToBoard::create($settings->fen, $board);
$board = FenToBoardFactory::create($settings->fen, $board);
}
$sanPlay = new SanPlay($settings->movetext, $board);
} elseif ($argv[1] === Game::VARIANT_CAPABLANCA) {
$board = new CapablancaBoard();
if (isset($settings->fen)) {
$board = FenToBoard::create($settings->fen, $board);
$board = FenToBoardFactory::create($settings->fen, $board);
}
$sanPlay = new SanPlay($settings->movetext, $board);
} elseif ($argv[1] === Game::VARIANT_CAPABLANCA_FISCHER) {
$startPos = str_split($settings->startPos);
$board = new CapablancaFischerBoard($startPos);
if (isset($settings->fen)) {
$board = FenToBoard::create($settings->fen, $board);
$board = FenToBoardFactory::create($settings->fen, $board);
}
$sanPlay = new SanPlay($settings->movetext, $board);
} else {
$board = new ClassicalBoard();
if (isset($settings->fen)) {
$board = FenToBoard::create($settings->fen, $board);
$board = FenToBoardFactory::create($settings->fen, $board);
}
$sanPlay = new SanPlay($settings->movetext, $board);
}
Expand Down
10 changes: 5 additions & 5 deletions src/Game/AbstractMode.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace ChessServer\Game;

use Chess\FenToBoard;
use Chess\FenToBoardFactory;
use Chess\Function\StandardFunction;
use Chess\Heuristics\FenHeuristics;
use Chess\Movetext\NagMovetext;
Expand Down Expand Up @@ -69,9 +69,9 @@ public function res($argv, $cmd)
$argv[2] === Game::VARIANT_CAPABLANCA ||
$argv[2] === Game::VARIANT_CAPABLANCA_FISCHER
) {
$board = FenToBoard::create($argv[1], new CapablancaBoard());
$board = FenToBoardFactory::create($argv[1], new CapablancaBoard());
} else {
$board = FenToBoard::create($argv[1], new ClassicalBoard());
$board = FenToBoardFactory::create($argv[1], new ClassicalBoard());
}
return [
$cmd->name => [
Expand Down Expand Up @@ -116,9 +116,9 @@ public function res($argv, $cmd)
$argv[2] === Game::VARIANT_CAPABLANCA ||
$argv[2] === Game::VARIANT_CAPABLANCA_FISCHER
) {
$board = FenToBoard::create($argv[1], new CapablancaBoard());
$board = FenToBoardFactory::create($argv[1], new CapablancaBoard());
} else {
$board = FenToBoard::create($argv[1], new ClassicalBoard());
$board = FenToBoardFactory::create($argv[1], new ClassicalBoard());
}
$paragraph = (new FenExplanation($board, $isEvaluated = true))->getParagraph();
return [
Expand Down

0 comments on commit 8ee6901

Please sign in to comment.