mirror of
https://github.com/runuo/runuo
synced 2026-08-11 22:26:04 -04:00
- Fixed a typo in the Huntsman's Forest region name. - Added the Bravehorn's drinking pool and Huntsman's Forest quest regions to Felucca. - Fixed CheckObjectTypes not sending invalid condition replies, because the commands are not always flushed after checking this. - When using an item condition with [online or [ipaddress, the command will now correctly say it does not support items. - The [Go menu now handles comments in the XML location files correctly. - Added the Increased Karma Loss attribute. - Renamed DummyTheif to DummyThief.
82 lines
No EOL
1.3 KiB
C#
82 lines
No EOL
1.3 KiB
C#
using System;
|
|
using System.Xml;
|
|
using System.Collections;
|
|
using Server;
|
|
|
|
namespace Server.Gumps
|
|
{
|
|
public class ParentNode
|
|
{
|
|
private ParentNode m_Parent;
|
|
private object[] m_Children;
|
|
|
|
private string m_Name;
|
|
|
|
public ParentNode( XmlTextReader xml, ParentNode parent )
|
|
{
|
|
m_Parent = parent;
|
|
|
|
Parse( xml );
|
|
}
|
|
|
|
private void Parse( XmlTextReader xml )
|
|
{
|
|
if ( xml.MoveToAttribute( "name" ) )
|
|
m_Name = xml.Value;
|
|
else
|
|
m_Name = "empty";
|
|
|
|
if ( xml.IsEmptyElement )
|
|
{
|
|
m_Children = new object[0];
|
|
}
|
|
else
|
|
{
|
|
ArrayList children = new ArrayList();
|
|
|
|
while ( xml.Read() && ( xml.NodeType == XmlNodeType.Element || xml.NodeType == XmlNodeType.Comment ) )
|
|
{
|
|
if ( xml.NodeType == XmlNodeType.Comment )
|
|
continue;
|
|
|
|
if ( xml.Name == "child" )
|
|
{
|
|
ChildNode n = new ChildNode( xml, this );
|
|
|
|
children.Add( n );
|
|
}
|
|
else
|
|
{
|
|
children.Add( new ParentNode( xml, this ) );
|
|
}
|
|
}
|
|
|
|
m_Children = children.ToArray();
|
|
}
|
|
}
|
|
|
|
public ParentNode Parent
|
|
{
|
|
get
|
|
{
|
|
return m_Parent;
|
|
}
|
|
}
|
|
|
|
public object[] Children
|
|
{
|
|
get
|
|
{
|
|
return m_Children;
|
|
}
|
|
}
|
|
|
|
public string Name
|
|
{
|
|
get
|
|
{
|
|
return m_Name;
|
|
}
|
|
}
|
|
}
|
|
} |