diff --git a/AssortValidator.Common/Helpers/QuestHelper.cs b/AssortValidator.Common/Helpers/QuestHelper.cs index 5e61c38..8f0feb4 100644 --- a/AssortValidator.Common/Helpers/QuestHelper.cs +++ b/AssortValidator.Common/Helpers/QuestHelper.cs @@ -259,21 +259,21 @@ namespace AssortValidator.Common.Helpers { "6179afd0bca27a099552e040", "Lost Contact"}, { "613708a7f8333a5d15594368", "Action Test"} }; - private static QuestRoot _liveQuestData; + private static Dictionary _liveQuestData; - public static QuestRoot GetLiveQuestData(string filename = "resp.client.quest.list") + public static Dictionary GetQuestData(string filename = "resp.client.quest.list") { if (_liveQuestData == null) { var questFilePath = InputFileHelper.GetInputFilePaths().FirstOrDefault(x => x.Contains(filename)); var questDataJson = File.ReadAllText(questFilePath); - _liveQuestData = JsonSerializer.Deserialize(questDataJson); + _liveQuestData = JsonSerializer.Deserialize>(questDataJson); } return _liveQuestData; } - public static List GetQuestAssortUnlocks(List quests) + public static List GetQuestAssortUnlocks(IEnumerable quests) { var results = new List(); @@ -283,12 +283,13 @@ namespace AssortValidator.Common.Helpers { results.Add(new QuestAssortUnlock{ QuestId = quest._id, - QuestName = QuestHelper.GetQuestNameById(quest._id), + QuestName = GetQuestNameById(quest._id), TraderId = assortUnlockReward.traderId, TraderType = TraderHelper.GetTraderTypeById(assortUnlockReward.traderId), AssortId = assortUnlockReward.items[0]._id, AssortTemplateId = assortUnlockReward.items[0]._tpl, - LoyaltyLevel = assortUnlockReward.loyaltyLevel.GetValueOrDefault(0) + LoyaltyLevel = assortUnlockReward.loyaltyLevel.GetValueOrDefault(0), + QuestState = "success" }); } } @@ -297,6 +298,31 @@ namespace AssortValidator.Common.Helpers return results; } + public static QuestAssorts CreateQuestAssortsList(IEnumerable questAssortData) + { + var result = new QuestAssorts(); + foreach (var questAssortUnlock in questAssortData) + { + result.success.Add(questAssortUnlock.AssortId, questAssortUnlock.QuestId); + } + + return result; + } + + public class QuestAssorts + { + public QuestAssorts() + { + started = new Dictionary(); + success = new Dictionary(); + fail = new Dictionary(); + } + + public Dictionary started { get; set; } + public Dictionary success { get; set; } + public Dictionary fail { get; set; } + } + private static string GetQuestNameById(string id) { if (questNames.ContainsKey(id))