Exemple #1
0
 public void AppendAddedChunks(IffFile file)
 {
     foreach (var chunk in file.SilentListAll())
     {
         if (chunk == this)
         {
             continue;
         }
         var entries = Entries.ToList();
         entries.Add(new PIFFEntry()
         {
             ChunkID     = chunk.ChunkID,
             ChunkLabel  = chunk.ChunkLabel,
             ChunkFlags  = chunk.ChunkFlags,
             EntryType   = PIFFEntryType.Add,
             NewDataSize = (uint)(chunk.ChunkData?.Length ?? 0),
             Type        = chunk.ChunkType
         });
         Entries = entries.ToArray();
     }
 }
Exemple #2
0
 public PIFFListItem(PIFFEntry entry, IffFile target)
 {
     Entry = entry;
     if (entry.ChunkLabel != "")
     {
         Name = entry.ChunkLabel;
     }
     else
     {
         //try find the original to get name
         var chunks = target.SilentListAll();
         Replaced = chunks.FirstOrDefault(chunk => chunk.ChunkType == entry.Type && chunk.OriginalID == entry.ChunkID);
         if (Replaced == null)
         {
             Name = "UNKNOWN";
         }
         else
         {
             Name = Replaced.OriginalLabel;
         }
     }
 }