protected ArchiveEntry(WildstarFile indexFile, WildstarAssets assets, IArchiveDirectoryEntry parent, int blockNumber, string name) { Parent = parent; _blockNumber = blockNumber; IndexFile = indexFile; Assets = assets; Name = name; }
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)); }
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; } }
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); } }
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); } }
public ArchiveDirectoryEntry(WildstarFile indexFile, WildstarAssets assets, IArchiveDirectoryEntry parent, int blockNumber, string name) : base(indexFile, assets, parent, blockNumber, name) { _children = new Lazy <List <IArchiveEntry> >(ReadChildren); }
public WildstarDatabase(IArchiveDirectoryEntry databaseDirectory) : this(databaseDirectory.Children.OfType <IArchiveFileEntry>().Where(i => i.Name.EndsWith(".tbl", StringComparison.InvariantCultureIgnoreCase)).Select(i => i.ToTable())) { }
public static WildstarDatabase ToDatabase(this IArchiveDirectoryEntry directory) { return(new WildstarDatabase(directory)); }