/// <summary> /// Creates a new DoorEventArgs object /// </summary> /// <param name="info">The DoorInfo object describing the door</param> /// <param name="category">The category this door belongs to</param> public DoorEventArgs(DoorInfo info, string category) { m_Name = info.Name; m_Item = info.Item; m_BaseID = info.BaseID; m_Category = category; }
/// <summary> /// Loads the DoorsData from the Data assembly /// </summary> private void Load() { var stream = Pandora.DataAssembly.GetManifestResourceStream("Data.Doors.xml"); var dom = new XmlDocument(); dom.Load(stream); stream.Close(); var root = dom.ChildNodes[1]; foreach (XmlNode xNode in root.ChildNodes) { if (xNode.ChildNodes.Count == 0) { // Portcullis m_PortNS = xNode.Attributes["itemNS"].Value; m_PortEW = xNode.Attributes["itemEW"].Value; m_PortName = xNode.Attributes["name"].Value; m_PortEWBase = int.Parse(xNode.Attributes["EW"].Value); m_PortNSBase = int.Parse(xNode.Attributes["NS"].Value); } else { var gNode = new GenericNode(xNode.Attributes["name"].Value); m_Structure.Add(gNode); foreach (XmlNode doorNode in xNode.ChildNodes) { gNode.Elements.Add(DoorInfo.FromXmlNode(doorNode)); } } } }
/// <summary> /// Creates a DoorInfo from an Xml node /// </summary> /// <param name="xNode">The XmlNode to convert to a door info</param> /// <returns>A Door Info object</returns> public static DoorInfo FromXmlNode(XmlNode xNode) { var door = new DoorInfo(); door.Name = xNode.Attributes["name"].Value; door.Item = xNode.Attributes["item"].Value; door.BaseID = int.Parse(xNode.Attributes["base"].Value); return(door); }
public InternalMenuItem(DoorInfo info) : base(info.Name) { m_Door = info; }
/// <summary> /// Creates a DoorInfo from an Xml node /// </summary> /// <param name="xNode">The XmlNode to convert to a door info</param> /// <returns>A Door Info object</returns> public static DoorInfo FromXmlNode( XmlNode xNode ) { DoorInfo door = new DoorInfo(); door.m_Name = xNode.Attributes[ "name" ].Value; door.m_Item = xNode.Attributes[ "item" ].Value; door.m_BaseID = int.Parse( xNode.Attributes[ "base" ].Value ); return door; }
/// <summary> /// Creates a new DoorEventArgs object /// </summary> /// <param name="info">The DoorInfo object describing the door</param> /// <param name="category">The category this door belongs to</param> public DoorEventArgs( DoorInfo info, string category ) { m_Name = info.Name; m_Item = info.Item; m_BaseID = info.BaseID; m_Category = category; }
public InternalMenuItem( DoorInfo info ) : base( info.Name ) { m_Door = info; }