Example #1
0
 public static ClientServerCommon.Attribute LoadFromXml(SecurityElement element)
 {
     return(new ClientServerCommon.Attribute {
         type = TypeNameContainer <_AvatarAttributeType> .Parse(element.Attribute("Type"), 0),
         value = StrParser.ParseDouble(element.Attribute("Value"), 0.0)
     });
 }
Example #2
0
 public TalentValue LoadTalentValueFromXml(SecurityElement element)
 {
     return(new TalentValue {
         Level = StrParser.ParseDecInt(element.Attribute("Level"), 0),
         Value = StrParser.ParseDouble(element.Attribute("Value"), 0.0)
     });
 }
Example #3
0
 public ValueFix LoadValueFixFromXml(SecurityElement element)
 {
     return(new ValueFix {
         Type = TypeNameContainer <_RankType> .Parse(element.Attribute("Type"), 0),
         SearchValue = StrParser.ParseDouble(element.Attribute("SearchValue"), 0.0),
         PassBossValue = StrParser.ParseDouble(element.Attribute("PassBossValue"), 0.0),
         ChallengeBossValue = StrParser.ParseDouble(element.Attribute("ChallengeBossValue"), 0.0)
     });
 }
Example #4
0
 public void LoadWeightIncreasesFromXml(SecurityElement element)
 {
     if (element.Children != null)
     {
         foreach (SecurityElement element2 in element.Children)
         {
             string str;
             if (((str = element2.Tag) != null) && (str == "WeightIncrease"))
             {
                 WeightIncrease item = new WeightIncrease {
                     Level    = StrParser.ParseDecInt(element2.Attribute("Level"), 0),
                     Increase = StrParser.ParseDouble(element2.Attribute("Increase"), 0.0)
                 };
                 this._weightIncreases.Add(item);
             }
         }
     }
 }
Example #5
0
        public Refresh LoadRefreshFromXml(SecurityElement element)
        {
            Refresh refresh = new Refresh {
                RefreshId   = StrParser.ParseHexInt(element.Attribute("RefreshId"), 0),
                OperateType = TypeNameContainer <_OperateType> .Parse(element.Attribute("OperateType"), 0),
                RefreshType = TypeNameContainer <_RefreshType> .Parse(element.Attribute("RefreshType"), 0),
                RefreshName = StrParser.ParseStr(element.Attribute("RefreshName"), "")
            };

            if (element.Children != null)
            {
                foreach (SecurityElement element2 in element.Children)
                {
                    Counter counter;
                    string  tag = element2.Tag;
                    if (tag != null)
                    {
                        if (tag == "Cost")
                        {
                            refresh.Cost = new Cost();
                            refresh.Cost = Cost.LoadFromXml(element2);
                        }
                        else if (tag == "Counter")
                        {
                            goto Label_00D9;
                        }
                    }
                    continue;
Label_00D9:
                    counter                      = new Counter();
                    counter.CounterId            = StrParser.ParseHexInt(element2.Attribute("CounterId"), 0);
                    counter.NeedRefreshTimes     = StrParser.ParseDecInt(element2.Attribute("NeedRefreshTimes"), 0);
                    counter.CloseActivatedTimes  = StrParser.ParseDecInt(element2.Attribute("CloseActivatedTimes"), 0);
                    counter.EffectiveProbability = StrParser.ParseDouble(element2.Attribute("EffectiveProbability"), 0.0);
                    counter.CardPackId           = StrParser.ParseHexInt(element2.Attribute("CardPackId"), 0);
                    counter.IsShowCounter        = StrParser.ParseBool(element2.Attribute("IsShowCounter"), false);
                    refresh.Counters.Add(counter);
                }
            }
            return(refresh);
        }
Example #6
0
        public static TargetCondition LoadFromXml(SecurityElement element)
        {
            int num = TypeNameContainer <_Type> .Parse(element.Attribute("Type"), 0);

            if (num == 0)
            {
                return(null);
            }
            TargetCondition condition = new TargetCondition {
                type = num
            };

            switch (num)
            {
            case 1:
            case 2:
            case 3:
                condition.intValue = TypeNameContainer <_SubType> .Parse(element.Text, 0);

                return(condition);

            case 4:
            case 5:
            case 0x10:
            case 0x11:
                return(condition);

            case 6:
                condition.stringValue = StrParser.ParseStr(element.Text, condition.stringValue);
                condition.intValue    = TypeNameContainer <_ConditionValueCompareType> .Parse(element.Attribute("Compare"), condition.intValue);

                condition.doubleValue = StrParser.ParseDouble(element.Attribute("CompareValue"), condition.doubleValue);
                return(condition);

            case 7:
            case 8:
                condition.boolValue = StrParser.ParseBool(element.Attribute("SingleRowColumn"), false);
                condition.intValue  = TypeNameContainer <_SubType> .Parse(element.Text, 0);

                return(condition);

            case 9:
                condition.intValue = StrParser.ParseDecInt(element.Text, 0);
                return(condition);

            case 10:
                condition.intValue = TypeNameContainer <_SubType> .Parse(element.Text, 0);

                condition.intValue1 = TypeNameContainer <_AvatarAttributeType> .Parse(element.Attribute("AttributeType"), 0);

                condition.boolValue = StrParser.ParseBool(element.Attribute("AscendingSort"), true);
                return(condition);

            case 11:
                condition.intValue = TypeNameContainer <AvatarConfig._AvatarCountryType> .ParseBitList(element.Text, 0);

                return(condition);

            case 12:
            {
                string[] strArray = element.Text.Split(new char[] { ',' });
                condition.intValue  = StrParser.ParseDecInt(strArray[0], 1);
                condition.intValue1 = StrParser.ParseDecInt(strArray[1], 1);
                return(condition);
            }

            case 13:
                condition.intValue = TypeNameContainer <AvatarConfig._CharacterType> .Parse(element.Text, 0);

                return(condition);

            case 14:
                condition.intValue = StrParser.ParseHexInt(element.Text, 0);
                return(condition);

            case 15:
                condition.enumList.AddRange(TypeNameContainer <CombatTurn._Type> .ParseList(element.Text, 0));
                return(condition);

            case 0x12:
                condition.intValue = TypeNameContainer <ClientServerCommon.Buff._BuffType> .Parse(element.Attribute("BuffType"), 0);

                condition.intValue1 = StrParser.ParseHexInt(element.Attribute("BuffId"), 0);
                return(condition);

            case 0x13:
                condition.stringValue = StrParser.ParseStr(element.Text, condition.stringValue);
                condition.intValue    = TypeNameContainer <_ConditionValueCompareType> .Parse(element.Attribute("Compare"), 0);

                condition.doubleValue = StrParser.ParseDouble(element.Attribute("CompareValue"), 0.0);
                condition.intValue1   = TypeNameContainer <_ConditionValueCompareType> .Parse(element.Attribute("CountCompare"), 0);

                condition.doubleValue1 = StrParser.ParseDouble(element.Attribute("CountCompareValue"), 0.0);
                return(condition);

            case 20:
                condition.intValue = TypeNameContainer <_SubType> .Parse(element.Text, 0);

                return(condition);

            case 0x15:
                condition.stringValue = StrParser.ParseStr(element.Text, string.Empty);
                condition.intValue    = TypeNameContainer <_ConditionValueCompareType> .Parse(element.Attribute("Compare"), 0);

                condition.doubleValue = StrParser.ParseDouble(element.Attribute("CompareValue"), 0.0);
                return(condition);

            case 0x16:
                condition.enumList.AddRange(TypeNameContainer <_SubType> .ParseList(element.Text, 0));
                return(condition);

            case 0x17:
                condition.intValue = TypeNameContainer <_SubType> .Parse(element.Text, 0);

                return(condition);

            case 0x18:
                condition.intValue = TypeNameContainer <AvatarAction.Event._Type> .Parse(element.Text, 0);

                condition.intValue1 = TypeNameContainer <ClientServerCommon.Buff._BuffType> .Parse(element.Attribute("BuffType"), 0);

                return(condition);
            }
            return(condition);
        }