private void UpdatePlayer1Score() { try { player1.ScoreUpdate(); lblP1Score.Text = player1.Score.ToString(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);; } }
/// <summary> /// Method that handles all activities for player 3 and resets configuration for player 1. /// </summary> private void Player3_Turn() { try { if (game.IsActive) { timeLeft = 25; game.Turn = player3; picP2.BackColor = Color.FromArgb(0, 128, 55); picP3.BackColor = Color.FromArgb(255, 255, 128); lblTurnName.Text = $"{player3.Name}'s"; //Pauses the turn for the player between 1-5 seconds,otherwise it will turns will almost //become instantenous PauseForMilliSeconds(r.Next(1000, 5000)); player3.Turn(aDeck, dumpCards, PanelDump); UpdateStockCount(); // Handles dump card for player 3 PauseForMilliSeconds(r.Next(5000, 7000)); DumpCard(player3); player3.PlayHand.Sort(); Hand.ShowHandBack(player3.CardsPanel, player3.PlayHand); player3.ScoreUpdate(); //Checkgame status CheckGameStatus(); //reset to P1's Turn picP3.BackColor = Color.FromArgb(0, 128, 55); picP1.BackColor = Color.FromArgb(255, 255, 128); PanelHandP1.Enabled = false; lblTurnName.Text = $"{player1.Name}'s"; timeLeft = 25; game.Turn = player1; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);; } }