// возвращает удиницу путиа пути) то есть путь от вершины до нужной верщины 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); } }
// удоляет первое вхождение unit public void Remove_path(Path_unit unit) { this.paths.Remove(unit); count_of_paths--; }
// возвращает индекс unit в листе, начиная с нулевого public int Get_index_of(Path_unit unit) { return(this.paths.BinarySearch(unit, new Path_comparer())); }
public void Add_path(Path_unit unit) { this.paths.Add(unit); count_of_paths++; this.paths.Sort(new Path_comparer()); }