Пример #1
0
        public override Figure Load(StreamReader sr, FigureFactory factory)
        {
            int count = Convert.ToInt32(sr.ReadLine());

            sr.ReadLine();
            for (int i = 0; i < count; i++)
            {
                char   symbol = (char)sr.Read();
                Figure figure = factory.CreateFigure(symbol);
                Add(figure.Load(sr, factory));
            }
            return(this);
        }
Пример #2
0
        public override Figure Load(StreamReader sr, FigureFactory factory)
        {
            string str = sr.ReadLine();

            sr.ReadLine();
            int count = Convert.ToInt32(str.Substring(13, str.Length - 13));

            for (int i = 0; i < count; i++)
            {
                char   symbol = (char)sr.Read();
                Figure figure = factory.CreateFigure(symbol);
                Add(figure.Load(sr, factory));
            }
            sr.ReadLine();
            sr.ReadLine();
            return(this);
        }