예제 #1
0
    private void LoadChapterConfig( )
    {
        CXmlContainer xml  = new CXmlContainer();
        List <string> list = new List <string> ();

        if (xml.LoadXML("data/chapter_proto", "id", list))
        {
            for (int i = 0; i < list.Count; i++)
            {
                tagChapterProto item = new tagChapterProto();
                item.chapterID   = xml.GetInt("id", list[i], 0);
                item.iEnterLevel = xml.GetInt("level", list[i], 0);

                item.strName = xml.GetString("name", list[i], "");
                item.strBG   = xml.GetString("icon", list[i], "");

                m_mapChapter.Add(item.chapterID, item);
            }
        }
    }
예제 #2
0
    private void CaleChapter2Instance( )
    {
        foreach (var item in m_mapChapter)
        {
            tagChapterProto pChapter = item.Value;
            if (pChapter == null)
            {
                continue;
            }

            foreach (var i in m_mapInstance)
            {
                tagInstanceProto pInstance = i.Value;
                if (pInstance != null)
                {
                    List <tagInstanceProto> maplist = null;
                    m_mapChaID2map.TryGetValue(pChapter.chapterID, out maplist);
                    if (maplist != null)
                    {
                        if (pChapter.chapterID == pInstance.chapterID)
                        {
                            maplist.Add(pInstance);
                        }
                    }
                    else
                    {
                        maplist = new List <tagInstanceProto>();
                        if (pChapter.chapterID == pInstance.chapterID)
                        {
                            maplist.Add(pInstance);
                        }
                        m_mapChaID2map.Add(pChapter.chapterID, maplist);
                    }
                }
            }
        }
    }