public BackwardsScanner(FileStream str, WorldHeader head) { stream = str; MaxX = head.MaxTiles.X; MaxY = head.MaxTiles.Y; header = head; backReader = new BackwardsBinaryReader(stream); }
public String GetWorldName(String worldFile) { String worldName; String headerName; int headerId; try { stream = new FileStream(worldFile, FileMode.Open, FileAccess.Read); reader = new BinaryReader(stream); backReader = new BackwardsBinaryReader(stream); } catch (Exception e) { e.ToString(); return "Error loading worldname"; } // Skip the release number. reader.ReadInt32(); headerName = reader.ReadString(); headerId = reader.ReadInt32(); if (CompareFooter(headerName, headerId) == true) worldName = headerName; else worldName = "Not a valid World file"; reader.Close(); return worldName; }