private MpqArchive() { this.syncRoot = new object(); this.resolveStreamEventArgs = new ResolveStreamEventArgs(); this.fileCollection = new MpqFileCollection(this); this.listFileParsed = false; }
private void ResolveBaseFile(object sender, ResolveStreamEventArgs e) { var file = sender as MpqFile; if (file == null) { throw new InvalidOperationException(); } bool archiveFound = false; foreach (var archive in archiveList) { if (!archiveFound) { if (archive == file.Archive) { archiveFound = true; } continue; } var foundFile = archive.FindFile(file.Name); if (foundFile != null) { e.Stream = foundFile.Open(); return; } } }