Skip to content

Commit

Permalink
Renamed StartPosition as Shuffle
Browse files Browse the repository at this point in the history
  • Loading branch information
programarivm committed Feb 17, 2025
1 parent 43c9f46 commit 6373474
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/Command/Game/Game.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
use Chess\Variant\VariantType;
use Chess\Variant\Capablanca\Board as CapablancaBoard;
use Chess\Variant\CapablancaFischer\Board as CapablancaFischerBoard;
use Chess\Variant\CapablancaFischer\StartPosition as CapablancaFischerStartPosition;
use Chess\Variant\CapablancaFischer\Shuffle as CapablancaFischerShuffle;
use Chess\Variant\Chess960\Board as Chess960Board;
use Chess\Variant\Chess960\StartPosition as Chess960StartPosition;
use Chess\Variant\Chess960\Shuffle as Chess960Shuffle;
use Chess\Variant\Classical\Board as ClassicalBoard;
use Chess\Variant\Classical\PGN\Color;
use Chess\Variant\Classical\PGN\Termination;
Expand Down Expand Up @@ -38,12 +38,12 @@ public function __construct(string $variant, string $mode)
$this->mode = $mode;

if ($this->variant === VariantType::CHESS_960) {
$shuffle = (new Chess960StartPosition())->create();
$shuffle = (new Chess960Shuffle())->create();
$this->board = new Chess960Board($shuffle);
} elseif ($this->variant === VariantType::CAPABLANCA) {
$this->board = new CapablancaBoard();
} elseif ($this->variant === VariantType::CAPABLANCA_FISCHER) {
$shuffle = (new CapablancaFischerStartPosition())->create();
$shuffle = (new CapablancaFischerShuffle())->create();
$this->board = new CapablancaFischerBoard($shuffle);
} elseif ($this->variant === VariantType::CLASSICAL) {
$this->board = new ClassicalBoard();
Expand Down
12 changes: 6 additions & 6 deletions src/Command/Game/NonBlocking/StartCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
use Chess\Variant\VariantType;
use Chess\Variant\Capablanca\Board as CapablancaBoard;
use Chess\Variant\CapablancaFischer\Board as CapablancaFischerBoard;
use Chess\Variant\CapablancaFischer\StartPosition as CapablancaFischerStartPosition;
use Chess\Variant\CapablancaFischer\Shuffle as CapablancaFischerShuffle;
use Chess\Variant\Chess960\Board as Chess960Board;
use Chess\Variant\Chess960\StartPosition as Chess960StartPosition;
use Chess\Variant\Chess960\Shuffle as Chess960Shuffle;
use Chess\Variant\Classical\Board as ClassicalBoard;
use Chess\Variant\Classical\PGN\Color;
use Chess\Variant\Dunsany\Board as DunsanyBoard;
Expand Down Expand Up @@ -49,7 +49,7 @@ public function run(AbstractSocket $socket, array $argv, int $id)
$shuffle = str_split($params['settings']['shuffle']);
$board = FenToBoardFactory::create($params['settings']['fen'], new Chess960Board($shuffle));
} else {
$shuffle = (new Chess960StartPosition())->create();
$shuffle = (new Chess960Shuffle())->create();
$board = new Chess960Board($shuffle);
}
} elseif ($params['variant'] === VariantType::CAPABLANCA) {
Expand All @@ -61,7 +61,7 @@ public function run(AbstractSocket $socket, array $argv, int $id)
$shuffle = str_split($params['settings']['shuffle']);
$board = FenToBoardFactory::create($params['settings']['fen'], new CapablancaFischerBoard($shuffle));
} else {
$shuffle = (new CapablancaFischerStartPosition())->create();
$shuffle = (new CapablancaFischerShuffle())->create();
$board = new CapablancaFischerBoard($shuffle);
}
} elseif ($params['variant'] === VariantType::DUNSANY) {
Expand Down Expand Up @@ -102,7 +102,7 @@ public function run(AbstractSocket $socket, array $argv, int $id)
$shuffle = str_split($params['settings']['shuffle']);
$board = FenToBoardFactory::create($params['settings']['fen'], new Chess960Board($shuffle));
} else {
$shuffle = (new Chess960StartPosition())->create();
$shuffle = (new Chess960Shuffle())->create();
$board = new Chess960Board($shuffle);
}
} elseif ($params['variant'] === VariantType::CAPABLANCA) {
Expand All @@ -114,7 +114,7 @@ public function run(AbstractSocket $socket, array $argv, int $id)
$shuffle = str_split($params['settings']['shuffle']);
$board = FenToBoardFactory::create($params['settings']['fen'], new CapablancaFischerBoard($shuffle));
} else {
$shuffle = (new CapablancaFischerStartPosition())->create();
$shuffle = (new CapablancaFischerShuffle())->create();
$board = new CapablancaFischerBoard($shuffle);
}
} elseif ($params['variant'] === VariantType::DUNSANY) {
Expand Down

0 comments on commit 6373474

Please sign in to comment.