private void InsertBreakBetween(string stationA, string stationB) { int aId = sd.GetKey(stationA); int bId = sd.GetKey(stationB); if (aId == -1) { throw new ArgumentException(stationA + " is misspelt"); } if (bId == -1) { throw new ArgumentException(stationB + " is misspelt"); } var children = MetroNetwork.GenChildrenFromStationId(aId); for (int i = 0; i < children.Count(); i++) { if (children[i].StationId == bId) { MetroNetwork.InsertBreakBetween(aId, children[i]); break; } } }
public string CutEdge(int index) { Node child = Children[index]; MetroNetwork.InsertBreakBetween(ParentId, child); string rec = LineDiction.GetValue(child.LineIndex) + ": " + StationDiction.GetValue(ParentId) + " - " + StationDiction.GetValue(child.StationId); return(rec); }