示例#1
0
        /*** Functions for loading/checking the different pub/map files ***/

        //tries to load the map that MainPlayer.ActiveCharacter is hanging out on
        private bool _tryLoadMap(int mapID = -1)
        {
            try
            {
                if (mapID < 0)
                {
                    mapID = MainPlayer.ActiveCharacter.CurrentMap;
                }

                string mapFile = Path.Combine("maps", string.Format("{0,5:D5}.emf", mapID));

                if (!MapCache.ContainsKey(mapID))
                {
                    MapCache.Add(mapID, new MapFile(mapFile));
                }
                else
                {
                    MapCache[mapID] = new MapFile(mapFile);
                }

                //map renderer construction moved to be more closely coupled to loading of the map
                (m_mapRender ?? (m_mapRender = new EOMapRenderer(EOGame.Instance, m_api))).SetActiveMap(MapCache[mapID]);
            }
            catch
            {
                return(false);
            }

            return(true);
        }
示例#2
0
        /*** Functions for loading/checking the different pub/map files ***/

        //tries to load the map that MainPlayer.ActiveCharacter is hanging out on
        private bool _tryLoadMap(int mapID = -1)
        {
            try
            {
                if (mapID < 0)
                {
                    mapID = MainPlayer.ActiveCharacter.CurrentMap;
                }

                string mapFile = Path.Combine("maps", string.Format("{0,5:D5}.emf", mapID));

                if (!MapCache.ContainsKey(mapID))
                {
                    MapCache.Add(mapID, new MapFile(mapFile));
                }
                else
                {
                    MapCache[mapID] = new MapFile(mapFile);
                }
            }
            catch
            {
                return(false);
            }

            return(true);
        }