Пример #1
0
        public override void Read(XmlElement os)
        {
            for (int i = 0; i < os.Attributes.Count; i++)
            {
                XmlAttribute child = os.Attributes[i] as XmlAttribute;
                if (child == null)
                {
                    continue;
                }
                switch (child.Name)
                {
                case "Id":
                    this.Id = ReadInt32(child.Value);
                    break;

                case "Name":
                    this.Name = child.Value;
                    break;

                case "Dur":
                    this.Dur = ReadFloat(child.Value);
                    break;

                case "Speed":
                    this.Speed = ReadFloat(child.Value);
                    break;

                case "CD":
                    this.CD = ReadFloat(child.Value);
                    break;

                case "Dist":
                    this.Dist = ReadFloat(child.Value);
                    break;

                case "CostType":
                    this.CostType = (ESkillCostType)ReadInt32(child.Value);
                    break;

                case "CostNum":
                    this.CostNum = ReadInt32(child.Value);
                    break;
                }
            }

            XmlNode pNode = os.FirstChild;

            while (pNode != null)
            {
                ActData data = new ActData();
                data.Read(pNode as XmlElement);
                Actions.Add(data);
                pNode = pNode.NextSibling;
            }
        }
Пример #2
0
        public override void Read(XmlElement os)
        {
            for (int i = 0; i < os.Attributes.Count; i++)
            {
                XmlAttribute child = os.Attributes[i] as XmlAttribute;
                if (child == null)
                {
                    continue;
                }
                switch (child.Name)
                {
                case "Type":
                    this.Type = (EActType)Enum.Parse(typeof(EActType), child.Value);
                    break;

                case "Time":
                    this.Time = ReadFloat(child.Value);
                    break;

                case "Action":
                    break;

                case "Affect":
                    this.AffectParam = new ParamAffect();
                    this.AffectParam.Parse(child.Value);
                    break;

                case "Warning":
                    this.Warning = ReadBool(child.Value);
                    break;
                }
            }
            XmlNode pNode = os.FirstChild;

            while (pNode != null)
            {
                ActData data = new ActData();
                data.Read(pNode as XmlElement);
                Actions.Add(data);
                pNode = pNode.NextSibling;
            }
        }