private LineSegmentStations getStationsSegment(Station s1, Station s2, out bool invert) { int id = LineSegmentStations.getIdForSegments(s1, s2, out invert); if (!segments.ContainsKey(id)) { segments[id] = new LineSegmentStations(s1, s2, this); } return(segments[id]); }
public void addLine(Station s1, Station s2, MapTransportLine line, Direction d) { LineSegmentStations lss = getStationsSegment(s1, s2, out bool invert); if (invert) { switch (d) { case Direction.S1_TO_S2: d = Direction.S2_TO_S1; break; case Direction.S2_TO_S1: d = Direction.S1_TO_S2; break; } } lss.addLine(line, d); }