public void ParseInfo(Hashtable info) { NewQuest = new QuestInfo(dataCollection); if (info.ContainsKey((int)SPC.NewQuest)) { Hashtable hash = info[(int)SPC.NewQuest] as Hashtable; if (hash != null) { NewQuest.ParseInfo(hash); } } PlayerQuests = new PlayerQuestsInfo(dataCollection); if (info.ContainsKey((int)SPC.Info)) { Hashtable hash = info[(int)SPC.Info] as Hashtable; if (hash != null) { PlayerQuests.ParseInfo(hash); } } }
public void ParseInfo(Hashtable info) { CompletedQuests.Clear(); if (info.ContainsKey((int)SPC.CompletedQuests)) { string[] arr = info[(int)SPC.CompletedQuests] as string[]; CompletedQuests.AddRange(arr); } StartedQuests.Clear(); if (info.ContainsKey((int)SPC.StartedQuests)) { Hashtable[] hashArr = info[(int)SPC.StartedQuests] as Hashtable[]; if (hashArr != null) { foreach (Hashtable questHash in hashArr) { QuestInfo quest = new QuestInfo(dataCollection); quest.ParseInfo(questHash); StartedQuests.Add(quest); } } } QuestVariables.Clear(); if (info.ContainsKey((int)SPC.Variables)) { Hashtable varHash = info[(int)SPC.Variables] as Hashtable; if (varHash != null) { foreach (System.Collections.DictionaryEntry entry in varHash) { QuestVariables.Add(entry.Key.ToString(), entry.Value); } } } }