private bool createSection(string sectionType, string sectionID, string[] sectionLines)
        {
            IParsableFactory sectionFactory;

            if (sectionFactories.TryGetValue(sectionType, out sectionFactory))
            {
                LDLBOBase parsed = sectionFactory.CreateItem(sectionLines, sectionID);
                parsedObjects.Add(parsed.ID, parsed);
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public override void DoSecondPass(Dictionary <string, LDLBOBase> parsedObjects)
        {
            LDLBOBase foundTC = null;
            int       idx     = 0;

            foreach (string tcStr in JoinedCircuitStrs)
            {
                if (parsedObjects.TryGetValue(tcStr, out foundTC))
                {
                    JoinedCircuits[idx++] = foundTC as LDLTrackCircuit;
                }
            }
            if (this.Location != null)
            {
                this.Location.DoSecondPass(parsedObjects);
            }
        }
示例#3
0
        public override void DoSecondPass(Dictionary <string,LDLBOBase> parsedObjects)
        {
            LDLBOBase foundObject = null;

            if (!string.IsNullOrEmpty(RBCStr))
            {
                if (parsedObjects.TryGetValue(RBCStr,out foundObject))
                {
                    RBC = foundObject as LDLRBC;
                }
            }
            if (BaliseStrs.Count > 0)
            {
                Balises = new List <LDLBalise>();
                foreach (string baliseID in BaliseStrs)
                {
                    if (parsedObjects.TryGetValue(baliseID,out foundObject))
                    {
                        Balises.Add((LDLBalise)foundObject);
                    }
                }
            }
        }
示例#4
0
        public override void DoSecondPass(Dictionary <string, LDLBOBase> parsedObjects)
        {
            LDLBOBase foundObject;

            if (!string.IsNullOrEmpty(InterlockingStr))
            {
                parsedObjects.TryGetValue(InterlockingStr, out foundObject);
                Interlocking = foundObject as LDLInterlocking;
            }
            if (!string.IsNullOrEmpty(EntranceStr))
            {
                parsedObjects.TryGetValue(EntranceStr, out foundObject);
                Entrance = foundObject;
            }
            if (!string.IsNullOrEmpty(ExitStr))
            {
                parsedObjects.TryGetValue(ExitStr, out foundObject);
                Exit = foundObject;
            }
            if (Sections != null)
            {
                Sections.DoSecondPass(parsedObjects);
            }
        }