Exemplo n.º 1
0
        public bool Init()
        {
            errMsg   = string.Empty;
            HasError = false;

            string[] columnNames = { nXColumnName, nYColumnName, nTempleteIDColumnName };
            npcTable = new MapLogicalTableReader(MapLogicalFilePath, TableName, columnNames);
            if (!npcTable.Init())
            {
                errMsg  += string.Format("{0} has error!", MapLogicalFilePath);
                HasError = true;
                return(false);
            }
            if (!LoadConfig())
            {
                errMsg  += string.Format("{0} has errors!", ConfigFilePath);
                HasError = true;
                return(false);
            }
            return(true);
        }
Exemplo n.º 2
0
        public bool Init()
        {
            errMsg = string.Empty;
            HasError = false;

            string[] columnNames = { nXColumnName, nYColumnName, nTempleteIDColumnName };
            npcTable = new MapLogicalTableReader(MapLogicalFilePath, TableName, columnNames);
            if (!npcTable.Init())
            {
                errMsg += string.Format("{0} has error!", MapLogicalFilePath);
                HasError = true;
                return false;
            }
            if (!LoadConfig())
            {
                errMsg += string.Format("{0} has errors!", ConfigFilePath);
                HasError = true;
                return false;
            }
            return true;
        }
Exemplo n.º 3
0
        public bool Init(string strRootdir, Hashtable htMapId)
        {
            m_strRootDir = strRootdir;

            string strMapName;
            int nMapId;
            foreach (DictionaryEntry de in htMapId)
            {
                strMapName = de.Value.ToString();
                nMapId = (int)de.Key;
                m_htMapId[strMapName] = nMapId;
                m_htMapName[nMapId] = strMapName;
            }
            string strLogicalFilePath;
            const string NPC = "NPC";
            const string Doodad = "Doodad";
            string[] ReadingColumns = { nXColumnName, nYColumnName, nTempleteIDColumnName };
            foreach (string mapname in m_htMapName.Values)
            {
                strLogicalFilePath = string.Format("{0}/data/source/maps/{1}/{1}.Map.Logical", m_strRootDir, mapname);

                MapLogicalTableReader npcReader = new MapLogicalTableReader(strLogicalFilePath, NPC, ReadingColumns);
                MapLogicalTableReader DoodadReader = new MapLogicalTableReader(strLogicalFilePath, Doodad, ReadingColumns);
                if (npcReader.Init())
                {
                    m_htMapNameNpcTable[mapname] = npcReader;
                }                
                if (DoodadReader.Init())
                {
                    m_htMapNameDoodadTable[mapname] = DoodadReader;
                } 

                //regionInfo
                //RegionInfo region = new RegionInfo();
                //if (region.Init(m_strRootDir, mapname))
                //{
                //    m_htRegionInfo[mapname] = region;
                //}
                //
                //Hashtable htTemplateIdGreeyIds = new Hashtable(MaxTemplateCapcity);
                //m_htMapNameHashTableGreeyIds[mapname] = htTemplateIdGreeyIds;

            }
            return true;
        }