Beispiel #1
0
        // возвращает удиницу путиа пути) то есть путь от вершины до нужной верщины
        public Path_unit Get_Path_unit(int destination)
        {
            Path_unit unit  = new Path_unit(destination, 0);
            int       index = this.paths.BinarySearch(unit, new Path_comparer());

            if (index >= 0)
            {
                return(this.paths[index]);
            }
            else
            {
                return(null);
            }
        }
Beispiel #2
0
 // удоляет первое вхождение unit
 public void Remove_path(Path_unit unit)
 {
     this.paths.Remove(unit);
     count_of_paths--;
 }
Beispiel #3
0
 // возвращает индекс unit в листе, начиная с нулевого
 public int Get_index_of(Path_unit unit)
 {
     return(this.paths.BinarySearch(unit, new Path_comparer()));
 }
Beispiel #4
0
 public void Add_path(Path_unit unit)
 {
     this.paths.Add(unit);
     count_of_paths++;
     this.paths.Sort(new Path_comparer());
 }