Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renamed HeuristicCommand as PlotCommand #447

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
use ChessServer\Command\AbstractBlockingCommand;
use ChessServer\Socket\AbstractSocket;

class HeuristicCommand extends AbstractBlockingCommand
class PlotCommand extends AbstractBlockingCommand
{
public function __construct()
{
$this->name = '/heuristic';
$this->description = 'Balance of a chess heuristic.';
$this->name = '/plot';
$this->description = 'Plots the oscillations of an evaluation feature in the time domain.';
$this->params = [
'params' => '<string>',
];
Expand All @@ -25,7 +25,7 @@ public function run(AbstractSocket $socket, array $argv, int $id)
{
$params = $this->params($argv[1]);

$this->pool->add(new HeuristicTask($params))
$this->pool->add(new PlotTask($params))
->then(function ($result) use ($socket, $id) {
return $socket->getClientStorage()->send([$id], [
$this->name => $result,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Chess\Variant\Classical\Board as ClassicalBoard;
use ChessServer\Command\AbstractBlockingTask;

class HeuristicTask extends AbstractBlockingTask
class PlotTask extends AbstractBlockingTask
{
public function run()
{
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,7 @@

use ChessServer\Command\AbstractCli;
use ChessServer\Command\Game\Blocking\ExtractCommand;
use ChessServer\Command\Game\Blocking\HeuristicCommand;
use ChessServer\Command\Game\Blocking\PlotCommand;
use ChessServer\Command\Game\Blocking\LeaveCommand;
use ChessServer\Command\Game\Blocking\PlayCommand;
use ChessServer\Command\Game\Blocking\PlayLanCommand;
Expand Down Expand Up @@ -45,7 +45,7 @@ public function __construct(Pool $pool)
// param-based commands
$this->commands->attach(new AcceptPlayRequestCommand());
$this->commands->attach((new ExtractCommand())->setPool($pool));
$this->commands->attach((new HeuristicCommand())->setPool($pool));
$this->commands->attach((new PlotCommand())->setPool($pool));
$this->commands->attach((new LeaveCommand())->setPool($pool));
$this->commands->attach(new LegalCommand());
$this->commands->attach((new PlayCommand())->setPool($pool));
Expand Down