public void Load(string xml) { Clear(); DialogConditionFactory conditionFactory = new DialogConditionFactory(); UniXmlDocument document = new UniXmlDocument(xml); var dumpList = document.document.Element("dialogs").Elements("dialog").Select(dElem => { string id = dElem.GetString("id"); var topicList = dElem.Element("topics").Elements("topic").Select(tElem => { string character = tElem.GetString("character"); string voice = tElem.GetString("voice"); string text = tElem.GetString("text"); return(new DialogTopic(character, text, voice)); }).ToList(); List <DialogCondition> startConditions = null; var startConditionsElement = dElem.Element("start_conditions"); if (startConditionsElement != null) { startConditions = conditionFactory.CreateList(new UniXMLElement(startConditionsElement)); } if (startConditions == null) { startConditions = new List <DialogCondition>(); } int index = dElem.GetInt("index"); Dialog dialog = new Dialog(id, topicList, startConditions, index); Add(id, dialog); return(dialog); }).ToList(); }
public void Load(string xml, string lang) { UniXmlDocument document = new UniXmlDocument(xml); UniXMLElement langElement = null; switch (lang) { case "ru": { langElement = new UniXMLElement(document.document.Element("compose").Element("ru")); } break; default: { langElement = new UniXMLElement(document.document.Element("compose").Element("en")); } break; } m_ComposeCollection = new Dictionary <string, ComposeData>(); var dump = langElement.Elements("data").Select(e => { ComposeData composeData = new ComposeData(e); m_ComposeCollection.Add(composeData.name, composeData); return(composeData); }).ToList(); }
public void Load(string xmlText) { UniXmlDocument document = new UniXmlDocument(xmlText); quests = document.document.Element("quests").Elements("quest").Select(qe => { return(new ManQuestData(new UniXMLElement(qe))); }).ToList(); }
public void Load(string xml) { stories = new Dictionary <string, LoreStoryData>(); UniXmlDocument document = new UniXmlDocument(xml); var dump = document.document.Element("stories").Elements("story").Select(se => { LoreStoryData story = new LoreStoryData(new UniXMLElement(se)); stories.Add(story.name, story); return(story); }).ToList(); }
public void Load(string xmlText) { categories.Clear(); UniXmlDocument documet = new UniXmlDocument(xmlText); var dump = documet.document.Element("achievments").Elements("category").Select(categoryElement => { AchievmentCategoryData category = new AchievmentCategoryData(new UniXMLElement(categoryElement)); categories.Add(category.id, category); return(category); }).ToList(); }
public void Load(string xml) { UniXmlDocument document = new UniXmlDocument(xml); models = new Dictionary <Race, StartPlayerRaceModel>(); UniXMLElement root = new UniXMLElement(document.document.Element("races")); var dump = root.Elements("race").Select(e => { StartPlayerRaceModel raceModel = new StartPlayerRaceModel(e); models.Add(raceModel.race, raceModel); return(raceModel); }).ToList(); }
public void Load(string xml) { UniXmlDocument document = new UniXmlDocument(xml); QuestOwners.Clear(); foreach (UniXMLElement element in document.Element("quest_owners").Elements("owner")) { QuestOwnerData data = new QuestOwnerData(); data.Load(element); QuestOwners[data.Id] = data; } }
public void Load(string xmlTex) { UniXmlDocument document = new UniXmlDocument(xmlTex); Quests.Clear(); foreach (var questElement in document.Element("quests").Elements("quest")) { Nebula.Client.Quests.QuestData questData = new Client.Quests.QuestData(); questData.Load(questElement); Quests[questData.Id] = questData; } }
public void Load(string text) { contracts.Clear(); UniXmlDocument document = new UniXmlDocument(text); var dump = document.document.Element("contracts").Elements("contract").Select(ce => { var contract = new ContractData(new UniXMLElement(ce)); if (false == contracts.ContainsKey(contract.id)) { contracts.Add(contract.id, contract); } return(contract); }).ToList(); }
public void Load(string xmlText) { if (m_Items == null) { m_Items = new Dictionary <string, ContractItemData>(); } m_Items.Clear(); UniXmlDocument document = new UniXmlDocument(xmlText); var dump = document.document.Element("contract_items").Elements("item").Select(itemElement => { ContractItemData data = new ContractItemData(new UniXMLElement(itemElement)); m_Items.Add(data.id, data); return(data); }).ToList(); }
public void Load(string xml) { map = new Dictionary <string, PlanetOreEntry>(); UniXmlDocument document = new UniXmlDocument(xml); var dump = document.document.Element("map").Elements("planet").Select(e => { PlanetOreEntry entry = new PlanetOreEntry(new UniXMLElement(e)); map.Add(entry.id, entry); return(entry); }).ToList(); planetZoneLinks = new Dictionary <string, string>(); var dump2 = document.document.Element("map").Element("planet_zone_links").Elements("link").Select(e => { string planet = e.Attribute("planet").Value; string zone = e.Attribute("zone").Value; if (!planetZoneLinks.ContainsKey(planet)) { planetZoneLinks.Add(planet, zone); } return(e); }).ToList(); }