コード例 #1
0
ファイル: QuestReward.cs プロジェクト: ftcaicai/ArkClient
        public static void LoadFromXml(QuestReward _reward, XmlNode _node)
        {
            string name = _node.Attributes["Type"].Value;

            switch (name)
            {
                case RewardTypeString.ID:
                    _reward.ID = Convert.ToInt32(_node.Attributes["ID"].Value);
                    break;
                case RewardTypeString.Exp:
                    _reward.ExperiencePoint = Convert.ToInt32(_node.Attributes["Exp"].Value);
                    break;

                case RewardTypeString.Money:
                    _reward.Money = Convert.ToInt32(_node.Attributes["Ark"].Value);
                    break;

                case RewardTypeString.Miracle:
                    _reward.Miracle = Convert.ToInt32(_node.Attributes["Miracle"].Value);
                    break;

                case RewardTypeString.Item:
                    {
                        RewardItem item = new RewardItem();

                        if (_node.Attributes["Class"] != null)
                            item.Class = (eCLASS)Enum.Parse(typeof(eCLASS), _node.Attributes["Class"].Value, true);
                        else
                            item.Class = eCLASS.NONE;

                        item.ID = Convert.ToInt32(_node.Attributes["ItemID"].Value);
                        item.Count = Convert.ToInt32(_node.Attributes["ItemCount"].Value);
                        _reward.Items.Add(item);
                    }
                    break;

                case RewardTypeString.ItemSelect:
                    {
                        RewardItem item = new RewardItem();
                        item.Class = eCLASS.All;
                        item.ID    = Convert.ToInt32(_node.Attributes["ItemID"].Value);
                        item.Count = Convert.ToInt32(_node.Attributes["ItemCount"].Value);
                        _reward.ItemsSelect.Add(item);
                    }
                    break;

                case RewardTypeString.Skill:
                    {
                        RewardSkill skill = new RewardSkill();
                        skill.ID = Convert.ToInt32(_node.Attributes["ID"].Value);
                        skill.Lv = Convert.ToInt32(_node.Attributes["Lv"].Value);
                        _reward.skill.Add(skill);
                    }
                    break;

                case RewardTypeString.Designaion:
                    {
                        RewardDesignation designaion = new RewardDesignation();
                        designaion.designationID = Convert.ToInt32(_node.Attributes["SubTitle"].Value);
                        _reward.designation.Add(designaion);
                    }
                    break;
            }

        }
コード例 #2
0
ファイル: QuestReward.cs プロジェクト: ftcaicai/ArkClient
 public static void LoadIDFromXml(QuestReward _reward, XmlNode _node)
 {
     _reward.ID = Convert.ToInt32(_node.Attributes["ID"].Value);
 }