/// <summary> /// Method emulates dealer moves /// </summary> private void DealerHit() { // if all busted or won no dealer's move! if (CheckAllBustOrWon()) { for (int i = 0; i < game.GetPlayersCount(); i++) { game.GameResults(i); } // emit the GameOver event GameOver(); cardtable.Invalidate(); return; } // Give dealer cards until he's got 17 or more while (game.GetDealer().CountScore() < 17) { MoveCardToDealer(); Thread.Sleep(300); } // Calculate the game results for each player for (int i = 0; i < game.GetPlayersCount(); i++) { game.GameResults(i); cardtable.Invalidate(); } // emit the GameOver event GameOver(); }