Esempio n. 1
0
        public void AddReferee()
        {
            StreamWriter streamWriter = new StreamWriter("Referees.txt", true);



            if (Referees.Count >= 1)
            {
                Console.WriteLine("W grze moze byc tylko jeden sedzia glowny. ");
                Console.WriteLine("W meczu moze byc tylko jeden sedzia glowny. ");
            }
            else
            {
                string imie;
                string nazwisko;
                imie     = Console.ReadLine();
                nazwisko = Console.ReadLine();
                VolleyballReferee referee = new VolleyballReferee(imie, nazwisko);
                Referees.Add(referee);
            }
            foreach (VolleyballReferee referee in Referees)
            {
                streamWriter.WriteLine(referee);
            }
        }
Esempio n. 2
0
        public void DeleteReferee()
        {
            if (Referees.Count <= 0)
            {
                Console.WriteLine("Brak sedziego");
            }
            else
            {
                StreamReader streamReader = new StreamReader("Referees.txt");

                string imie;
                string nazwisko;
                imie     = Console.ReadLine();
                nazwisko = Console.ReadLine();
                VolleyballReferee newReferee = new VolleyballReferee(imie, nazwisko);

                foreach (VolleyballReferee referee in Referees)
                {
                    if (referee == newReferee)
                    {
                        Referees.Remove(referee);
                    }
                }
            }
        }
Esempio n. 3
0
        public void AddMainReferee()
        {
            string imie;
            string nazwisko;

            imie     = Console.ReadLine();
            nazwisko = Console.ReadLine();
            VolleyballReferee mainReferee = new VolleyballReferee(imie, nazwisko);

            MainReferee = mainReferee;
        }