take the pawns at home into account when deciding if the user can choose a pawn

This commit is contained in:
2025-01-28 13:37:09 +01:00
parent 3e67b127a0
commit 0f141e1475

View File

@@ -89,7 +89,7 @@ void Engine::nextTurn() {
std::string choice; std::string choice;
bool pawnMoved = false; bool pawnMoved = false;
switch (currentPlayer.pawnsActive) { switch (currentPlayer.pawnsActive + currentPlayer.pawnsAtHome) {
// 0 pionków na planszy - musi wyjść pionkiem // 0 pionków na planszy - musi wyjść pionkiem
case 0: case 0:
@@ -147,13 +147,13 @@ void Engine::nextTurn() {
this->pawnmoveBuffer.play(); this->pawnmoveBuffer.play();
this->board.smartSleep(2000); this->board.smartSleep(2000);
break; break;
} else { } else {
std::cout << "Ups! Nie mozesz tego zrobic!\n"; std::cout << "Ups! Nie mozesz tego zrobic!\n";
std::cout << "Jedyna opcja to zagranie kolejnym pionkiem.\n"; std::cout << "Jedyna opcja to zagranie kolejnym pionkiem.\n";
this->invalidBuffer.play(); this->invalidBuffer.play();
this->board.smartSleep(1000); this->board.smartSleep(1000);
// Zróbmy to, co w a) // Zróbmy to, co w a)
pickAPlace = false; pickAPlace = false;
std::cout << currentPlayer.getName() << " wychodzi " std::cout << currentPlayer.getName() << " wychodzi "
<< currentPlayer.pawnsActive + 1 << ". pionkiem z bazy.\n"; << currentPlayer.pawnsActive + 1 << ". pionkiem z bazy.\n";
// Rusz pierwszy możliwy pionek w bazie: // Rusz pierwszy możliwy pionek w bazie: