Ejemplo n.º 1
0
        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.");
                }
            }
        }
Ejemplo n.º 2
0
 public void GetSpawnList()
 {
     m_SpawnList = CitySpawnList.GetRandomSpawnList(m_Crystal.SpawnDifficulty);
 }
Ejemplo n.º 3
0
 public void GetSpawnList()
 {
     m_SpawnList = CitySpawnList.GetRandomSpawnList(m_Crystal.SpawnDifficulty);
 }
Ejemplo n.º 4
0
        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.");
                }
            }
        }