Skip to content

Commit

Permalink
Wait 5 seconds between player move and PC move only in debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolarevelant committed Mar 15, 2024
1 parent 74eb7da commit 74e1e84
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/checkers/MatchManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/

#include "checkers/MatchManager.h"
#include <iostream>
#include <vector>
#include <unistd.h>

Expand Down Expand Up @@ -162,7 +163,10 @@ void MatchManager::updateDisposition(GameUtils::Disposition *newDisposition) {

void MatchManager::makePCMove() {
changeState(TURN_PC);
#ifdef DEBUG
std::cerr << "Waiting 5 seconds for debug..." << std::endl;
sleep(5); // TODO: test delay
#endif
auto *pcMove = GameUtils::calculateBestMove(mDisposition, mGameDifficulty);
if (pcMove == nullptr) {
// PC cannot do anything, player won
Expand Down

0 comments on commit 74e1e84

Please sign in to comment.