コード例 #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.");
                }
            }
        }
コード例 #2
0
 public void GetSpawnList()
 {
     m_SpawnList = CitySpawnList.GetRandomSpawnList(m_Crystal.SpawnDifficulty);
 }
コード例 #3
0
ファイル: CitySpawner.cs プロジェクト: greeduomacro/RunUO-1
 public void GetSpawnList()
 {
     m_SpawnList = CitySpawnList.GetRandomSpawnList(m_Crystal.SpawnDifficulty);
 }
コード例 #4
0
ファイル: CitySpawnList.cs プロジェクト: greeduomacro/RunUO-1
        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.");
                }
            }
        }