Exemplo n.º 1
0
        public static TmxMap LoadFromFile(string tmxPath)
        {
            // Refresh uniqueId counter
            TmxMap.NextUniqueId = 0;

            string fullTmxPath = Path.GetFullPath(tmxPath);

            using (ChDir chdir = new ChDir(fullTmxPath))
            {
                TmxMap    tmxMap = new TmxMap();
                XDocument doc    = tmxMap.LoadDocument(fullTmxPath);

                tmxMap.Name = Path.GetFileNameWithoutExtension(fullTmxPath);
                tmxMap.ParseMap(doc);

                // We're done reading and parsing the tmx file
                Program.WriteLine("Map details: {0}", tmxMap.ToString());
                Program.WriteSuccess("Finished parsing file: {0}", fullTmxPath);

                // Let listeners know of our success
                if (TmxMap.OnReadTmxFileCompleted != null)
                {
                    TmxMap.OnReadTmxFileCompleted(tmxMap);
                }

                return(tmxMap);
            }
        }
Exemplo n.º 2
0
        public static TmxMap LoadFromFile(string tmxPath)
        {
            // Refresh uniqueId counter
            TmxMap.NextUniqueId = 0;

            string fullTmxPath = Path.GetFullPath(tmxPath);
            using (ChDir chdir = new ChDir(fullTmxPath))
            {
                TmxMap tmxMap = new TmxMap();
                XDocument doc = tmxMap.LoadDocument(fullTmxPath);

                tmxMap.Name = Path.GetFileNameWithoutExtension(fullTmxPath);
                tmxMap.ParseMap(doc);

                // We're done reading and parsing the tmx file
                Program.WriteLine("Map details: {0}", tmxMap.ToString());
                Program.WriteSuccess("Finished parsing file: {0}", fullTmxPath);

                // Let listeners know of our success
                if (TmxMap.OnReadTmxFileCompleted != null)
                {
                    TmxMap.OnReadTmxFileCompleted(tmxMap);
                }

                return tmxMap;
            }
        }
Exemplo n.º 3
0
        public static TmxMap LoadFromFile(string tmxPath)
        {
            string fullPath = Path.GetFullPath(tmxPath);

            using (new ChDir(fullPath))
            {
                TmxMap    tmxMap = new TmxMap();
                XDocument doc    = LoadDocument(fullPath);
                tmxMap.Name = Path.GetFileNameWithoutExtension(fullPath);
                tmxMap.ParseMapXml(doc);
                Logger.WriteInfo("Map details: {0}", tmxMap.ToString());
                Logger.WriteSuccess("Parsed: {0} ", fullPath);
                tmxMap.IsLoaded = true;
                return(tmxMap);
            }
        }
Exemplo n.º 4
0
        public static TmxMap LoadFromFile(string tmxPath)
        {
            string fullTmxPath = Path.GetFullPath(tmxPath);
            using (ChDir chdir = new ChDir(fullTmxPath))
            {
                TmxMap tmxMap = new TmxMap();
                XDocument doc = tmxMap.LoadDocument(fullTmxPath);

                tmxMap.Name = Path.GetFileNameWithoutExtension(fullTmxPath);
                tmxMap.ParseMapXml(doc);

                // We're done reading and parsing the tmx file
                Logger.WriteLine("Map details: {0}", tmxMap.ToString());
                Logger.WriteSuccess("Parsed: {0} ", fullTmxPath);

                tmxMap.IsLoaded = true;
                return tmxMap;
            }
        }
Exemplo n.º 5
0
        public static TmxMap LoadFromFile(string tmxPath)
        {
            string fullTmxPath = Path.GetFullPath(tmxPath);

            using (ChDir chdir = new ChDir(fullTmxPath))
            {
                TmxMap    tmxMap = new TmxMap();
                XDocument doc    = tmxMap.LoadDocument(fullTmxPath);

                tmxMap.Name = Path.GetFileNameWithoutExtension(fullTmxPath);
                tmxMap.ParseMapXml(doc);

                // We're done reading and parsing the tmx file
                Logger.WriteLine("Map details: {0}", tmxMap.ToString());
                Logger.WriteSuccess("Parsed: {0} ", fullTmxPath);

                tmxMap.IsLoaded = true;
                return(tmxMap);
            }
        }