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 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); } }
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); } }
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; } }
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); } }
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 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; } }