private void ProcessElement_Expedition(XElement element) { this.Text = new Description(element.Element("ExpeditionName").Value); this.ExpeditionRegion = element.Element("ExpeditionRegion")?.Value; this.FillEventPool = element.Element("FillEventPool")?.Value; if (element.Element("Reward") != null) { var rewardAssets = Assets.Original.XPathSelectElements($"//Asset[Values/Standard/GUID={element.Element("Reward").Value}]/Values/Reward/RewardAssets/Item"); this.Rewards = new List <RewardPoolPosition>(); foreach (var rewardAsset in rewardAssets) { var position = new RewardPoolPosition(rewardAsset); var amount = rewardAsset.Element("Amount")?.Value ?? "1"; switch (amount) { case "3": this.Rewards.Add(position); this.Rewards.Add(position); this.Rewards.Add(position); break; case "2": this.Rewards.Add(position); this.Rewards.Add(position); break; case "1": this.Rewards.Add(position); break; } } } }
private void ProcessElement_Expedition(XElement element) { Text = new Description(element.Element("ExpeditionName").Value); ExpeditionRegion = element.Element("ExpeditionRegion")?.Value; FillEventPool = element.Element("FillEventPool")?.Value; if (element.Element("Reward") != null) { XElement asset; var id = element.Element("Reward").Value; Assets.GUIDs.TryGetValue(id, out asset); foreach (var rewardAsset in asset.XPathSelectElements($"/Values/Reward/RewardAssets/Item")) { var position = new RewardPoolPosition(rewardAsset); var amount = rewardAsset.Element("Amount")?.Value ?? "1"; switch (amount) { case "3": Rewards.Add(position); Rewards.Add(position); Rewards.Add(position); break; case "2": Rewards.Add(position); Rewards.Add(position); break; case "1": Rewards.Add(position); break; } } } }