예제 #1
0
 // Opens the dialog for adding a new player to the game
 private void playerToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (isStarted)
     {
         PlayerCreator form = new PlayerCreator();
         form.CompletionEvent += PlayerCreatorAddition_CompletionEvent;
         form.Show();
     }
 }
예제 #2
0
        // Allows editing of a selected player
        private void editToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            if (isStarted)
            {
                PlayerCreator form = new PlayerCreator(game.Players[playerListBox.SelectedIndex]);  // Passes in the selected player object.

                // Removes that player object from the lists
                game.Players.RemoveAt(playerListBox.SelectedIndex);
                playerListBox.Items.RemoveAt(playerListBox.SelectedIndex);

                form.CompletionEvent += PlayerCreatorAddition_CompletionEvent;
                form.Show();
            }
        }