Пример #1
0
        /// <summary>
        /// Reading airfields and static objects from files
        /// </summary>
        public void File()
        {
            try
            {
                string line;

                using (StreamReader str = new StreamReader("lotniska.txt"))
                {
                    while ((line = str.ReadLine()) != null)
                    {
                        int      x     = Convert.ToInt16(line);
                        int      y     = Convert.ToInt16(str.ReadLine());
                        string   nazwa = str.ReadLine();
                        Lotnisko nowe  = new Lotnisko(x, y, nazwa);
                        lotniska.Add(nowe);
                    }
                }
            }
            catch (IOException)
            {
                Console.WriteLine("brak pliku");
            }
            try
            {
                using (StreamReader str = new StreamReader("obiektystatyczne.txt"))
                {
                    string line;
                    while ((line = str.ReadLine()) != null)
                    {
                        int x = Convert.ToInt16(line);
                        int y = Convert.ToInt16(str.ReadLine());
                        int z = Convert.ToInt16(str.ReadLine());
                        statyczne.Add(new Tuple <int, int>(x, y));
                    }
                }
            }
            catch (IOException)
            {
                Console.WriteLine("brak pliku");
            }
            //wczytajmape();
        }
Пример #2
0
 public Lotnisko(Lotnisko lotnisko)
 {
 }