コード例 #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
ファイル: Load.cs プロジェクト: jizzyjim/16Below
        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
ファイル: Load.cs プロジェクト: romeov007/imagine-uo
		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 );
        }