private void StartGame_ButtonClick(object sender, EventArgs e) { pictureBox1.Click += new EventHandler(OnDartBoard_Click); LogWriter.Write("New game started."); MsgBox_Show.Show_Message("Game started!"); playerListBox.Enabled = false; start_Btn.Enabled = false; playerName_tb.Enabled = false; playerAdd_btn.Enabled = false; scoreboard.Visible = true; UpdateScoreboard(); game.SetPlayer(); }
private void AddPlayer_ButtonClick(object sender, EventArgs e) { string name = playerName_tb.Text; Player player = new Player(name); if (!game.CheckPlayerExists(player)) { game.AddPlayer(player); playerListBox.Items.Add(player); } else { MsgBox_Show.Show_Message(player.ToString() + " is already in the game!"); } playerName_tb.Clear(); playerName_tb.Focus(); }