예제 #1
0
 private SortedList<int, Relation> editRelationsIds(int max)
 {
     SortedList<int, Relation> relations_list_buf = new SortedList<int, Relation>();
     foreach (KeyValuePair<int, Relation> i in relations_list)
     {
         Relation buf = new Relation(i.Value.from + max, i.Value.to + max, i.Value.type);
         relations_list_buf.Add(i.Key + max, buf);
     }
     return relations_list_buf;
 }
예제 #2
0
 /* Добавить связь
  * @from айди элемента откуда идет связь
  * @to айди элемента куда идет связь
  * @type тип связи
  * @return id айди добавленного элемента
 */
 public int add_relation(int from, int to, string type)
 {
     max_id++;
     Relation obj = new Relation(from, to, type);
     relations_list.Add(max_id, obj);
     return max_id;
 }