private void GiveFormat(Queue <CdIndexEntry> entries, FileContainer folder) { CdIndexEntry entry = entries.Dequeue(); if (!entry.IsFolder) { folder.AddFile(new GameFile( entry.Name, new DataStream(this.File.Stream, entry.Offset, entry.Size) )); return; } // Create the folder GameFolder currFolder = new GameFolder(entry.Name, folder); // Add files and folders for (int i = 0; i < entry.SubEntries - 1; i++) { GiveFormat(entries, currFolder); } }