private void bAddToTeam_Click(object sender, EventArgs e) { UInt32 id = 0; UInt32.TryParse(tbID.Text, out id); CPlayer player = cgai.getDefultTeam().getPlayer(id); bAddToTeam.Enabled = false; if (player != null) { cgai.getDefultTeam().removePlayer(player); (lbTeamsList.SelectedItem as CTeam).addPlayer(player); lbChoosenTeam.DisplayMember = "DisplayName"; itemBindingChoosenTeam.ResetBindings(false); } else { MessageBox.Show("לא קיים שחקן עם ת.ז זו במערכת", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
public void addPlayer(CPlayer player) { //adds the player at the head of the list Players.Insert(0,player); }
public bool removePlayer(CPlayer player) { return Players.Remove(player); }
public bool removePlayer(CPlayer player) { return(Players.Remove(player)); }
public void addPlayer(CPlayer player) { //adds the player at the head of the list Players.Insert(0, player); }