Пример #1
0
        public static RewardGroup LoadXml(SecurityElement element)
        {
            RewardGroup group = new RewardGroup {
                possibility   = StrParser.ParseFloat(element.Attribute("Possibility"), 1f),
                rewardGroupId = StrParser.ParseHexInt(element.Attribute("Id"), 0)
            };

            if (element.Children != null)
            {
                foreach (SecurityElement element2 in element.Children)
                {
                    string tag = element2.Tag;
                    if (tag != null)
                    {
                        if (tag == "RewardTypeCount")
                        {
                            group.rewardTypeCounts.Add(RewardTypeCount.LoadFromXml(element2));
                        }
                        else if (tag == "Reward")
                        {
                            goto Label_0096;
                        }
                    }
                    continue;
Label_0096:
                    group.rewards.Add(Reward.LoadFromXml(element2));
                }
            }
            return(group);
        }
Пример #2
0
        public static RewardTypeCount LoadFromXml(SecurityElement element)
        {
            RewardTypeCount count = new RewardTypeCount {
                possibility = StrParser.ParseFloat(element.Attribute("Possibility"), 1f)
            };

            count.count = StrParser.ParseDecInt(element.Attribute("Count"), count.count);
            return(count);
        }