Пример #1
0
        private static SR_Rune AddTree(LocationTree tree, Map map)
        {
            SR_Rune runeBook = new SR_Rune(map.ToString(), true);

            for (int i = 0; i < tree.Root.Children.Length; i++)
            {
                runeBook.AddRune(AddNode(tree.Root.Children[i], map));
            }

            return(runeBook);
        }
Пример #2
0
        public static SR_Rune ReadRuneNode(XmlElement parent)
        {
            if (parent.LocalName == "Runebook")
            {
                SR_Rune runebook = new SR_Rune(parent.GetAttribute("Name"), true);
                if (parent.HasChildNodes)
                {
                    XmlElement child = parent.FirstChild as XmlElement;
                    runebook.AddRune(ReadRuneNode(child));
                    while (child.NextSibling != null)
                    {
                        child = child.NextSibling as XmlElement;
                        runebook.AddRune(ReadRuneNode(child));
                    }
                }
                return(runebook);
            }
            //else if( parent.LocalName == "Rune" )

            return(new SR_Rune(parent.GetAttribute("Name"), Map.Parse(parent.GetAttribute("TargetMap")), new Point3D(Utility.ToInt32(parent.GetAttribute("X")), Utility.ToInt32(parent.GetAttribute("Y")), Utility.ToInt32(parent.GetAttribute("Z")))));
        }
Пример #3
0
        private static SR_Rune AddNode(object o, Map map)
        {
            if (o is ParentNode)
            {
                ParentNode parentNode = o as ParentNode;
                SR_Rune    runeBook   = new SR_Rune(parentNode.Name, true);

                for (int i = 0; i < parentNode.Children.Length; i++)
                {
                    runeBook.AddRune(AddNode(parentNode.Children[i], map));
                }

                return(runeBook);
            }

            ChildNode childNode = o as ChildNode;

            return(new SR_Rune(childNode.Name, map, childNode.Location));
        }
Пример #4
0
		public static SR_Rune ReadRuneNode( XmlElement parent )
		{
			if( parent.LocalName == "Runebook" )
			{
				SR_Rune runebook = new SR_Rune(parent.GetAttribute("Name"), true);
				if( parent.HasChildNodes )
				{
					XmlElement child = parent.FirstChild as XmlElement;
					runebook.AddRune(ReadRuneNode(child));
					while( child.NextSibling != null )
					{
						child = child.NextSibling as XmlElement;
						runebook.AddRune(ReadRuneNode(child));
					}
				}
				return runebook;
			}
			//else if( parent.LocalName == "Rune" )

			return new SR_Rune(parent.GetAttribute("Name"), Map.Parse(parent.GetAttribute("TargetMap")), new Point3D(Utility.ToInt32(parent.GetAttribute("X")),Utility.ToInt32(parent.GetAttribute("Y")),Utility.ToInt32(parent.GetAttribute("Z"))) );
		}
Пример #5
0
        private static SR_Rune AddTree( LocationTree tree, Map map )
        {
            SR_Rune runeBook = new SR_Rune( map.ToString(), true );

            for( int i = 0; i < tree.Root.Children.Length; i++ )
                runeBook.AddRune( AddNode( tree.Root.Children[i], map ) );

            return runeBook;
        }
Пример #6
0
        private static SR_Rune AddNode( object o, Map map )
        {
            if( o is ParentNode )
            {
                ParentNode parentNode = o as ParentNode;
                SR_Rune runeBook = new SR_Rune( parentNode.Name, true );

                for( int i = 0; i < parentNode.Children.Length; i++ )
                    runeBook.AddRune( AddNode( parentNode.Children[i], map ) );

                return runeBook;
            }

            ChildNode childNode = o as ChildNode;

            return new SR_Rune( childNode.Name, map, childNode.Location );
        }