예제 #1
0
 public static partial void CustomBinaryEndImport(MutagenFrame frame, IDialogTopicInternal obj)
 {
     try
     {
         if (frame.Reader.Complete)
         {
             return;
         }
         if (!frame.TryGetGroup(out var groupMeta))
         {
             return;
         }
         if (groupMeta.GroupType == (int)GroupTypeEnum.TopicChildren)
         {
             obj.Timestamp = BinaryPrimitives.ReadInt32LittleEndian(groupMeta.LastModifiedData);
             obj.Unknown   = frame.GetInt32(offset: 20);
             if (FormKey.Factory(frame.MetaData.MasterReferences !, BinaryPrimitives.ReadUInt32LittleEndian(groupMeta.ContainedRecordTypeData)) != obj.FormKey)
             {
                 throw new ArgumentException("Dialog children group did not match the FormID of the parent.");
             }
         }
         else
         {
             return;
         }
         frame.Reader.Position += groupMeta.HeaderLength;
         obj.Responses.SetTo(ListBinaryTranslation <DialogResponses> .Instance.Parse(
                                 reader: frame.SpawnWithLength(groupMeta.ContentLength),
                                 transl: (MutagenFrame r, RecordType header, out DialogResponses listItem) =>
         {
             return(LoquiBinaryTranslation <DialogResponses> .Instance.Parse(
                        frame: r,
                        item: out listItem));
         }));
     }
     catch (Exception ex)
     {
         throw RecordException.Enrich(ex, obj);
     }
 }