void BearAction::perform(Table &table, Player *playerList, QueryResult queryResult) { int currentPlayer = gameInfo.currentPlayer; int x; queryResult.getPlayer(x); x--; Hand firstHand = playerList[currentPlayer].yourHand; playerList[currentPlayer].yourHand = playerList[x].yourHand; playerList[x].yourHand = firstHand;}
void DeerAction::perform(Table &table, Player *playerList, QueryResult queryResult) { int currentPlayer = gameInfo.currentPlayer; int x; queryResult.getPlayer(x); x--; // Correct the index string currentAnimal = playerList[currentPlayer].getSecretAnimal(); string otherAnimal = playerList[x].swapSecretAnimal(currentAnimal); playerList[currentPlayer].swapSecretAnimal(otherAnimal); }