Skip to content

Commit

Permalink
Renamed /good_pgn as /tutor_good_pgn
Browse files Browse the repository at this point in the history
  • Loading branch information
programarivm committed Feb 7, 2025
1 parent 48cc7fd commit 5485230
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
use ChessServer\Command\AbstractBlockingCommand;
use ChessServer\Socket\AbstractSocket;

class GoodPgnCommand extends AbstractBlockingCommand
class TutorGoodPgnCommand extends AbstractBlockingCommand
{
public function __construct()
{
$this->name = '/good_pgn';
$this->name = '/tutor_good_pgn';
$this->description = "Explains the why of a good move in terms of chess concepts.";
}

Expand All @@ -23,7 +23,7 @@ public function run(AbstractSocket $socket, array $argv, int $id)
$game = $socket->getGameModeStorage()->getById($id)->getGame();

if (!isset($game->state()->end)) {
$this->pool->add(new GoodPgnTask($game->getBoard()))
$this->pool->add(new TutorGoodPgnTask($game->getBoard()))
->then(function ($result) use ($socket, $id, $game) {
return $socket->getClientStorage()->send([$id], [
$this->name => $result,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use ChessServer\Command\AbstractBlockingTask;
use ChessServer\Socket\AbstractSocket;

class GoodPgnTask extends AbstractBlockingTask
class TutorGoodPgnTask extends AbstractBlockingTask
{
private Board $board;

Expand Down
4 changes: 2 additions & 2 deletions src/Command/Game/Cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use ChessServer\Command\AbstractCli;
use ChessServer\Command\Game\Blocking\ExtractCommand;
use ChessServer\Command\Game\Blocking\GoodPgnCommand;
use ChessServer\Command\Game\Blocking\LeaveCommand;
use ChessServer\Command\Game\Blocking\PlayCommand;
use ChessServer\Command\Game\Blocking\PlayLanCommand;
Expand All @@ -14,6 +13,7 @@
use ChessServer\Command\Game\Blocking\ResignCommand;
use ChessServer\Command\Game\Blocking\RestartCommand;
use ChessServer\Command\Game\Blocking\StockfishCommand;
use ChessServer\Command\Game\Blocking\TutorGoodPgnCommand;
use ChessServer\Command\Game\NonBlocking\AcceptPlayRequestCommand;
use ChessServer\Command\Game\NonBlocking\AsciiCommand;
use ChessServer\Command\Game\NonBlocking\DrawCommand;
Expand Down Expand Up @@ -46,7 +46,6 @@ public function __construct(Pool $pool)
// param-based commands
$this->commands->attach(new AcceptPlayRequestCommand());
$this->commands->attach((new ExtractCommand())->setPool($pool));
$this->commands->attach((new GoodPgnCommand())->setPool($pool));
$this->commands->attach((new LeaveCommand())->setPool($pool));
$this->commands->attach(new LegalCommand());
$this->commands->attach((new PlayCommand())->setPool($pool));
Expand All @@ -60,5 +59,6 @@ public function __construct(Pool $pool)
$this->commands->attach(new StartCommand());
$this->commands->attach((new StockfishCommand())->setPool($pool));
$this->commands->attach(new TutorFenCommand());
$this->commands->attach((new TutorGoodPgnCommand())->setPool($pool));
}
}

0 comments on commit 5485230

Please sign in to comment.