예제 #1
0
        public void ReadResourcesList()
        {
            using (StreamReader sr = new StreamReader(m_resourcesRoot))
            {
                while (!sr.EndOfStream)
                {
                    string s = sr.ReadLine();
                    if (s.Contains("#begin"))
                    {
                        s = s.Replace("#begin ", "");
                        string[] fname = s.Split('.');
                        switch (fname[1])
                        {
                        case "jpg":
                        case "png":
                        case "bmp":
                            if (m_textureDic.ContainsKey(fname[0]))
                            {
                                DebugManager.Debug(DebugType.Error, "Resources has exsited! Please cheack the name of : " + s);
                                return;
                            }
                            m_textureDic.Add(fname[0], null);
                            break;

                        case "wav":
                            if (m_soundDic.ContainsKey(fname[0]))
                            {
                                DebugManager.Debug(DebugType.Error, "Resources has exsited! Please cheack the name of : " + s);
                                return;
                            }
                            m_soundDic.Add(fname[0], null);
                            break;
                        }
                    }
                }
            }
        }