private void btnAddPlayerToGame_Click(object sender, EventArgs e)
 {
     if (!txtPlayerName.Text.Equals(string.Empty))
     {
         Player player = new Player()
         {
             Name = txtPlayerName.Text,
             Hand = new Hand()
         };
         game.AddPlayer(player);
         lstPlayers.Items.Add(txtPlayerName.Text);
         txtPlayerName.Text = string.Empty;
         Players.Add(player);
     }
 }
Exemple #2
0
 public int AddPlayer(Player player)
 {
     _players.Add(player);
     return _players.Count - 1;
 }