public static bool Save(WadFile wad, string path, WadVersion version) { if (File.Exists(path)) { return(false); } using (var stream = File.Open(path, FileMode.CreateNew, FileAccess.Write, FileShare.None)) { Save(wad, stream, version); return(true); } }
public static void Save(WadFile wad, Stream stream, WadVersion version) { switch (version) { // Wad2 (Quake I) case WadVersion.Wad2: { Wad2.Wad.Save(wad, stream); return; } // Wad3 (GoldSource) case WadVersion.Wad3: { Wad3.Wad.Save(wad, stream); return; } } throw new WadVersionNotSupportedException((uint)version); }
public bool Save(string path, WadVersion version) => Save(this, path, version);
public void Save(Stream stream, WadVersion version) => Save(this, stream, version);