public static VFileSystem MountArchive(string mountPoint, string zip)
 {
     if (!_mounts.ContainsKey(mountPoint))
     {
         _mounts.Add(mountPoint, VFileSystem.Create(zip));
     }
     else
     {
         _mounts[mountPoint].AddZip(zip);
     }
     return(_mounts[mountPoint]);
 }
コード例 #2
0
        public static VFileSystem Create(string zip)
        {
            Console.WriteLine("[VFS] Loading " + zip + "...");
            ZipArchive zipData    = new ZipArchive(new MemoryStream(File.ReadAllBytes(zip)));
            var        fileSystem = new VFileSystem();

            foreach (var zipEntry in zipData.Entries)
            {
                fileSystem.AddFile(zipEntry);
            }
            return(fileSystem);
        }