private static void Load(string filePath) { XmlDocument doc = new XmlDocument(); doc.Load(filePath); XmlElement root = doc["spawnsets"]; foreach (XmlElement element in root.GetElementsByTagName("set")) { string type = element.GetAttribute("type"); string difficulty = element.GetAttribute("difficulty"); difficulty = difficulty.ToLower(); if (String.IsNullOrEmpty(type)) { continue; } try { CitySpawnList list = new CitySpawnList(type, element); switch (difficulty) { case "novice": { m_Novice[type] = list; break; } case "expert": { m_Expert[type] = list; break; } case "master": { m_Master[type] = list; break; } default: { m_Notset[type] = list; break; } } } catch { Console.WriteLine("Error: City Spawn List not created."); } } }
public void GetSpawnList() { m_SpawnList = CitySpawnList.GetRandomSpawnList(m_Crystal.SpawnDifficulty); }
private static void Load(string filePath) { XmlDocument doc = new XmlDocument(); doc.Load(filePath); XmlElement root = doc["spawnsets"]; foreach (XmlElement element in root.GetElementsByTagName("set")) { string type = element.GetAttribute("type"); string difficulty = element.GetAttribute("difficulty"); difficulty = difficulty.ToLower(); if (String.IsNullOrEmpty(type)) continue; try { CitySpawnList list = new CitySpawnList(type, element); switch (difficulty) { case "novice": { m_Novice[type] = list; break; } case "expert": { m_Expert[type] = list; break; } case "master": { m_Master[type] = list; break; } default: { m_Notset[type] = list; break; } } } catch { Console.WriteLine("Error: City Spawn List not created."); } } }