Exemplo n.º 1
0
        public ConditionContainer load(String targetPath)
        {
            StreamReader reader = new StreamReader(File.OpenRead(targetPath + "condition_container.cc"));

            if (reader.ReadLine().Contains("def Segment"))
            {
                segments.Add(ConditionSegment.parseSegment(reader));
            }
            reader.Close();
            return(this);
        }
Exemplo n.º 2
0
        public static ConditionSegment parseSegment(StreamReader reader)
        {
            ConditionSegment segment = new ConditionSegment();
            bool             reading = true;

            while (reading)
            {
                string line = reader.ReadLine();
                if (line.Contains("def Condition"))
                {
                    segment.conditions.Add(Condition.parseCondition(reader));
                }
                else if (line.Contains("end Segment"))
                {
                    reading = false;
                }
            }
            return(segment);
        }