예제 #1
0
        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);
            }
        }
예제 #2
0
        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);
        }
예제 #3
0
 public bool Save(string path, WadVersion version) => Save(this, path, version);
예제 #4
0
 public void Save(Stream stream, WadVersion version) => Save(this, stream, version);