Beispiel #1
0
        private static Block LoadBlock(XmlTextReader xml)
        {
            int    x, y;
            string type;
            Block  block = null;

            x    = Int32.Parse(xml.GetAttribute("x"));
            y    = Int32.Parse(xml.GetAttribute("y"));
            type = xml.GetAttribute("type");

            if (type.Equals("FullPlain"))
            {
                block = new FullPlainBlock(x, y);
            }
            else if (type.Equals("HalfPlain"))
            {
                block = new HalfPlainBlock(x, y);
            }
            else if (type.Equals("FullSquareHole"))
            {
                block = new FullSquareHoleBlock(x, y);
            }
            else if (type.Equals("HalfSquareHole"))
            {
                block = new HalfSquareHoleBlock(x, y);
            }

            return(block);
        }
Beispiel #2
0
        private static Block LoadBlock(XmlTextReader xml)
        {
            int x, y;
            string type;
            Block block = null;

            x = Int32.Parse(xml.GetAttribute("x"));
            y = Int32.Parse(xml.GetAttribute("y"));
            type = xml.GetAttribute("type");

            if (type.Equals("FullPlain"))
                block = new FullPlainBlock(x, y);
            else if (type.Equals("HalfPlain"))
                block = new HalfPlainBlock(x, y);
            else if (type.Equals("FullSquareHole"))
                block = new FullSquareHoleBlock(x, y);
            else if (type.Equals("HalfSquareHole"))
                block = new HalfSquareHoleBlock(x, y);

            return block;
        }