internal void HandleSubrecord( MainRecord rec, PluginFileSource source, ref int defIndex ) { var subrecord = source.currentSubrecord; var def = GetMemberDef(subrecord.signature, ref defIndex); if (def == null) { rec._unexpectedSubrecords.Add(subrecord); source.SubrecordHandled(); } else if (def.IsSubrecord()) { def.ReadElement(rec, source, subrecord.dataSize); source.SubrecordHandled(); defIndex++; } else { var container = (Container)def.PrepareElement(rec); def.SubrecordFound(container, source); defIndex++; } }
public override void SubrecordFound( Container container, PluginFileSource source ) { int defIndex = 0; var subrecord = source.currentSubrecord; var memberDef = GetMemberDef(subrecord.signature, ref defIndex); if (memberDef == null) { return; } if (memberDef.IsSubrecord()) { memberDef.ReadElement(container, source, subrecord.dataSize); source.SubrecordHandled(); } else { memberDef.SubrecordFound(container, source); } }
internal bool HandleSubrecord( Container container, PluginFileSource source, ref int defIndex ) { var subrecord = source.currentSubrecord; var def = GetMemberDef(subrecord.signature, ref defIndex); if (def == null) { return(false); } if (def.IsSubrecord()) { def.ReadElement(container, source, subrecord.dataSize); source.SubrecordHandled(); } else { var e = (Container)def.PrepareElement(container); def.SubrecordFound(e, source); } defIndex++; return(true); }