private static void TryReadFile(string mapGeoFilePath, string binFilePath) { FileWrapper mapgeoFile = new FileWrapper(mapGeoFilePath); string magic = mapgeoFile.ReadString(4); if (magic != "OEGM") // 'MGEO' backwards { Console.WriteLine("Error: unrecognized magic value: " + magic); return; } int version = mapgeoFile.ReadInt(); // moon said this was an int Console.WriteLine("\nversion = " + version); List <int> allowedVersions = new List <int> { 6, 5, 7, 8, 9, 10, 11 }; if (allowedVersions.Contains(version) == false) { Console.WriteLine("Error: unrecognized version number: " + version); return; } FileWrapper binFile = null; if (binFilePath != "") { binFile = new FileWrapper(binFilePath); } MapGeoFileReader mapgeo = new MapGeoFileReader(mapgeoFile, version, binFile); mapgeo.ConvertFiles(); }
public TextFileWriter(FileWrapper file) { this.file = file; file.Clear(); // need to get rid of anything already there from a previous execution }