Skip to content

Commit

Permalink
Updated to PHP Chess 1.4.97
Browse files Browse the repository at this point in the history
  • Loading branch information
programarivm committed Jan 15, 2025
1 parent de2146d commit 53d7b5e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions src/Command/Game/Blocking/ExtractTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Chess\FenToBoardFactory;
use Chess\SanExtractor;
use Chess\Function\CompleteFunction;
use Chess\Eval\FastFunction;
use Chess\Variant\Capablanca\Board as CapablancaBoard;
use Chess\Variant\CapablancaFischer\Board as CapablancaFischerBoard;
use Chess\Variant\Chess960\Board as Chess960Board;
Expand All @@ -15,7 +15,7 @@ class ExtractTask extends AbstractBlockingTask
{
public function run()
{
$f = new CompleteFunction();
$f = new FastFunction();

if ($this->params['variant'] === Chess960Board::VARIANT) {
$startPos = str_split($this->params['startPos']);
Expand All @@ -37,8 +37,10 @@ public function run()
: new ClassicalBoard();
}

$steinitz = SanExtractor::steinitz($f, $board->clone(), $this->params['movetext']);

return [
'steinitz' => SanExtractor::steinitz($f, $board->clone(), $this->params['movetext']),
'steinitz' => FastFunction::normalize(-1, 1, $steinitz),
];
}
}
2 changes: 1 addition & 1 deletion src/Command/Game/Blocking/HeuristicTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Chess\FenToBoardFactory;
use Chess\SanPlotter;
use Chess\Function\CompleteFunction;
use Chess\Eval\CompleteFunction;
use Chess\Variant\Capablanca\Board as CapablancaBoard;
use Chess\Variant\CapablancaFischer\Board as CapablancaFischerBoard;
use Chess\Variant\Chess960\Board as Chess960Board;
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Game/Blocking/TutorFenTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace ChessServer\Command\Game\Blocking;

use Chess\FenToBoardFactory;
use Chess\Function\CompleteFunction;
use Chess\Eval\CompleteFunction;
use Chess\Tutor\FenEvaluation;
use Chess\Variant\Classical\Board;
use ChessServer\Command\AbstractBlockingTask;
Expand Down
4 changes: 2 additions & 2 deletions src/Command/Game/NonBlocking/EvalNamesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace ChessServer\Command\Game\NonBlocking;

use Chess\Function\CompleteFunction;
use Chess\Eval\CompleteFunction;
use ChessServer\Command\AbstractNonBlockingCommand;
use ChessServer\Socket\AbstractSocket;

Expand All @@ -22,7 +22,7 @@ public function validate(array $argv)
public function run(AbstractSocket $socket, array $argv, int $id)
{
return $socket->getClientStorage()->send([$id], [
$this->name => (new CompleteFunction())->names(),
$this->name => CompleteFunction::names(),
]);
}
}

0 comments on commit 53d7b5e

Please sign in to comment.