private void AddDuo() { if (!String.IsNullOrWhiteSpace(txtDuo1.Text) && txtDuo1.Text.Length > 0 && !String.IsNullOrWhiteSpace(txtDuo2.Text) && txtDuo2.Text.Length > 0) { Player teammate = new Player(null, txtDuo2.Text, 0); pList.AddDuo(new Player(teammate, txtDuo1.Text, 2)); txtDuo1.Clear(); txtDuo2.Clear(); txtDuo1.Select(); txtDuo1.Focus(); lblCount.Text = "Total Players: " + pList.totalPlayers; } }
public Player(Player team, String playerName, int playerCount) { teammate = team; name = playerName; count = playerCount; }
public void AddSolo(Player player) { playerList.Add(player); soloCount++; totalPlayers++; }
public void AddDuo(Player player) { playerList.Add(player); duoCount++; totalPlayers += 2; }