Example #1
0
        public List <MapEventCondition> Conditions2;                                  //间隔触发条件

        public override void Read(XmlNode os)
        {
            foreach (XmlNode current in XmlObject.GetChilds(os))
            {
                switch (current.Name)
                {
                case "Type":
                    this.Type = (MapTriggerType)ReadInt(current);
                    break;

                case "Id":
                    this.Id = ReadInt(current);
                    break;

                case "Active":
                    this.Active = ReadBool(current);
                    break;

                case "Relation1":
                    this.Relation1 = (ConditionRelationType)ReadInt(current);
                    break;

                case "Relation2":
                    this.Relation2 = (ConditionRelationType)ReadInt(current);
                    break;

                case "Conditions1":
                    XmlObject.GetChilds(current).ForEach(delegate(XmlNode pNode)
                    {
                        MapEventCondition data = new MapEventCondition();
                        data.Read(pNode);
                        Conditions1.Add(data);
                    });
                    break;

                case "Conditions2":
                    XmlObject.GetChilds(current).ForEach(delegate(XmlNode pNode)
                    {
                        MapEventCondition data = new MapEventCondition();
                        data.Read(pNode);
                        Conditions2.Add(data);
                    });
                    break;

                case "TriggerNum":
                    this.TriggerNum = ReadInt(current);
                    break;

                case "TriggerInterval":
                    this.TriggerInterval = ReadFloat(current);
                    break;

                case "TriggerDelay":
                    this.TriggerDelay = ReadFloat(current);
                    break;
                }
            }
        }