Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="node"></param>
        /// <returns></returns>
        public override bool Load(XmlNode xml)
        {
            if (xml == null || xml.Name != Tag)
            {
                return(false);
            }

            Type = xml.Attributes["type"] != null ? (StairType)Enum.Parse(typeof(StairType), xml.Attributes["type"].Value) : StairType.Up;

            foreach (XmlNode node in xml)
            {
                switch (node.Name.ToLower())
                {
                case "target":
                {
                    Target = new DungeonLocation();
                    Target.Load(node);
                }
                break;

                default:
                {
                    base.Load(node);
                }
                break;
                }
            }

            return(true);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="xml"></param>
        /// <returns></returns>
        public override bool Load(XmlNode xml)
        {
            if (xml == null || xml.Name != Tag)
            {
                return(false);
            }

            IsVisible = xml.Attributes["visible"] != null?bool.Parse(xml.Attributes["visible"].Value) : false;

            TeleportTeam = xml.Attributes["team"] != null?bool.Parse(xml.Attributes["team"].Value) : false;

            TeleportItems = xml.Attributes["items"] != null?bool.Parse(xml.Attributes["items"].Value) : false;

            TeleportMonsters = xml.Attributes["monster"] != null?bool.Parse(xml.Attributes["monster"].Value) : false;

            Reusable = xml.Attributes["resuable"] != null?bool.Parse(xml.Attributes["reusable"].Value) : false;

            foreach (XmlNode node in xml)
            {
                switch (node.Name.ToLower())
                {
                case "target":
                {
                    Target = new DungeonLocation();
                    Target.Load(node);
                }
                break;

                default:
                {
                    base.Load(node);
                }
                break;
                }
            }

            return(true);
        }
Ejemplo n.º 3
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="xml"></param>
		/// <returns></returns>
		public override bool Load(XmlNode xml)
		{
			if (xml == null || xml.Name != Tag)
				return false;

			IsVisible = xml.Attributes["visible"] != null ? bool.Parse(xml.Attributes["visible"].Value) : false;
			TeleportTeam = xml.Attributes["team"] != null ? bool.Parse(xml.Attributes["team"].Value) : false;
			TeleportItems = xml.Attributes["items"] != null ? bool.Parse(xml.Attributes["items"].Value) : false;
			TeleportMonsters = xml.Attributes["monster"] != null ? bool.Parse(xml.Attributes["monster"].Value) : false;
			Reusable = xml.Attributes["resuable"] != null ? bool.Parse(xml.Attributes["reusable"].Value) : false;

			foreach (XmlNode node in xml)
			{
				switch (node.Name.ToLower())
				{
					case "target":
					{
						Target = new DungeonLocation();
						Target.Load(node);
					}
					break;

					default:
					{
						base.Load(node);
					}
					break;
				}

			}

			return true;
		}
Ejemplo n.º 4
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="node"></param>
		/// <returns></returns>
		public override bool Load(XmlNode xml)
		{
			if (xml == null || xml.Name != Tag)
				return false;

			Type = xml.Attributes["type"] != null ? (StairType)Enum.Parse(typeof(StairType), xml.Attributes["type"].Value) : StairType.Up;

			foreach (XmlNode node in xml)
			{
				switch (node.Name.ToLower())
				{
					case "target":
					{
						Target = new DungeonLocation();
						Target.Load(node);
					}
					break;

					default:
					{
						base.Load(node);
					}
					break;
				}

			}

			return true;
		}