// constructor

            public LineRecord(int lineId) // sets up record structure
            {
                this.LineId   = lineId;
                this.LineName = LineDiction.GetValue(lineId);
                Records       = new List <Record>();
                DefaultStroke = new SolidColorBrush(LineDiction.GetLineColor(this.LineId)); // TODO : change s.t. are actual line colours

                for (int i = 0; i < MetroNetwork.Lines[lineId].Branches.Count(); i++)
                {
                    for (int j = 0; j < MetroNetwork.Lines[lineId].Branches[i].StopSequence.Count() - 1; j++)
                    {
                        Records.Add(new Record(lineId, i, j));

                        if (InValid(Records.Last()))
                        {
                            Records.RemoveAt(Records.Count() - 1);
                        }

                        else
                        {
                            Records.Last().DrawEdge(DefaultStroke);
                        }
                    }
                }
            }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        // editing methods

        public List <string> GetNeighbourNames(int parentId)
        {
            Children.Clear();
            this.ParentId = parentId;
            List <string> neighbours = new List <string>();

            Children = MetroNetwork.GenChildrenFromStationId(this.ParentId);
            string val;

            foreach (var child in Children)
            {
                val = LineDiction.GetValue(child.LineIndex) + ": " + StationDiction.GetValue(child.StationId);
                neighbours.Add(val);
            }

            return(neighbours);
        }