コード例 #1
0
 protected ArchiveEntry(WildstarFile indexFile, WildstarAssets assets, IArchiveDirectoryEntry parent, int blockNumber, string name)
 {
     Parent       = parent;
     _blockNumber = blockNumber;
     IndexFile    = indexFile;
     Assets       = assets;
     Name         = name;
 }
コード例 #2
0
 public ArchiveFileEntry(WildstarFile indexFile, WildstarAssets assets, IArchiveDirectoryEntry parent, int blockNumber, string name, BinaryReader reader) : base(indexFile, assets, parent, blockNumber, name)
 {
     Flags            = reader.ReadInt32();
     Reserved1        = reader.ReadInt64();
     UncompressedSize = reader.ReadInt64();
     CompressedSize   = reader.ReadInt64();
     Hash             = BitConverter.ToString(reader.ReadBytes(20)).Replace("-", "").ToLower();
     Reserved2        = reader.ReadInt32();
     _lazyArchiveFile = new Lazy <WildstarFile>(() => Assets.LocateArchiveWithAsset(Hash));
 }
コード例 #3
0
 public MergedArchiveDirectoryEntry(WildstarAssets assets, IEnumerable <IArchiveDirectoryEntry> directories = null, string name = null, IArchiveDirectoryEntry parent = null)
 {
     _name             = name;
     _parent           = parent;
     Assets            = assets;
     _directoryEntries = directories?.ToList() ?? assets.RootDirectoryEntries.ToList();
     _children         = GroupDirectories(_directoryEntries.SelectMany(i => i.Children)).ToList();
     if (_directoryEntries.Count == 1)
     {
         BlockNumber = _directoryEntries[0].BlockNumber;
         IndexFile   = _directoryEntries[0].IndexFile;
     }
 }
コード例 #4
0
        public IEnumerable <IArchiveEntry> GetArchiveEntries(IArchiveDirectoryEntry directory)
        {
            yield return(directory);

            foreach (var child in directory.Children)
            {
                if (child is IArchiveDirectoryEntry)
                {
                    foreach (var innerChild in GetArchiveEntries(child as IArchiveDirectoryEntry))
                    {
                        yield return(innerChild);
                    }
                    continue;
                }
                yield return(child);
            }
        }
コード例 #5
0
 private static IEnumerable <IArchiveFileEntry> EnumerateFiles(IArchiveDirectoryEntry directoryEntry)
 {
     foreach (var item in directoryEntry.Children)
     {
         var directory = item as IArchiveDirectoryEntry;
         if (directory != null)
         {
             foreach (var inner in EnumerateFiles(directory))
             {
                 yield return(inner);
             }
             continue;
         }
         var file = item as IArchiveFileEntry;
         yield return(file);
     }
 }
コード例 #6
0
 public ArchiveDirectoryEntry(WildstarFile indexFile, WildstarAssets assets, IArchiveDirectoryEntry parent, int blockNumber, string name) : base(indexFile, assets, parent, blockNumber, name)
 {
     _children = new Lazy <List <IArchiveEntry> >(ReadChildren);
 }
コード例 #7
0
 public WildstarDatabase(IArchiveDirectoryEntry databaseDirectory) : this(databaseDirectory.Children.OfType <IArchiveFileEntry>().Where(i => i.Name.EndsWith(".tbl", StringComparison.InvariantCultureIgnoreCase)).Select(i => i.ToTable()))
 {
 }
コード例 #8
0
 public static WildstarDatabase ToDatabase(this IArchiveDirectoryEntry directory)
 {
     return(new WildstarDatabase(directory));
 }