Beispiel #1
0
 public void PlayerAdd(Player player)
 {
     Players.Add(player);
 }
Beispiel #2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            teams.Clear();

            //TODO
            StreamReader file = new StreamReader(path + "HomeTeam.txt");
            string lijn;
            int teller = 0; ;
            while ((lijn = file.ReadLine()) != null)
            {
                if (teller == 0)
                {
                    teams.Add(new Team(lijn));
                    teller++;
                }
                else
                {
                    string[] appart = lijn.Split('|');



                    Player pr = new Player();
                    pr.Name = appart[0];
                    pr.Number = int.Parse(appart[1]);
                    teams[0].Players.Add(pr);

                }



            }

            file.Close();

            SortPlayersTeam();
            ShowTeams();

        }