Exemple #1
0
 /// <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;
 }
Exemple #2
0
        /// <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));
                    }
                }
            }
        }
Exemple #3
0
        /// <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);
        }
Exemple #4
0
 public InternalMenuItem(DoorInfo info)
     : base(info.Name)
 {
     m_Door = info;
 }
Exemple #5
0
		/// <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;
		}
Exemple #6
0
		/// <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;
		}
Exemple #7
0
			public InternalMenuItem( DoorInfo info ) : base( info.Name )
			{
				m_Door = info;
			}