public static partial void FillBinaryFlagsCustom(MutagenFrame frame, IFurnitureInternal item) { var subFrame = frame.ReadSubrecordFrame(); // Read flags like normal item.Flags = (Furniture.Flag)BinaryPrimitives.ReadUInt16LittleEndian(subFrame.Content); }
static partial void FillBinaryPatrolScriptMarkerCustom(MutagenFrame frame, IPatrol item) { if (frame.ReadSubrecordFrame().Content.Length != 0) { throw new ArgumentException($"Marker had unexpected length."); } }
static partial void FillBinaryBoundDataCustom(MutagenFrame frame, IPlacedObjectInternal item) { var header = frame.ReadSubrecordFrame(); if (header.Content.Length != 4) { throw new ArgumentException($"Unexpected data header length: {header.Content.Length} != 4"); } item.Unknown = BinaryPrimitives.ReadInt16LittleEndian(header.Content.Slice(2)); while (frame.Reader.TryReadSubrecord(out var subHeader)) { switch (subHeader.RecordTypeInt) { case RecordTypeInts.LNAM: item.LightingTemplate = FormKeyBinaryTranslation.Instance.Parse(frame); break; case RecordTypeInts.INAM: item.ImageSpace = FormKeyBinaryTranslation.Instance.Parse(frame); break; case RecordTypeInts.XLRM: item.LinkedRooms.Add(new FormLink <PlacedObject>(FormKeyBinaryTranslation.Instance.Parse(frame))); break; default: frame.Reader.Position -= subHeader.HeaderLength; return; } } }
public static partial ParseResult FillBinaryPatrolScriptMarkerCustom(MutagenFrame frame, IPatrol item, PreviousParse lastParsed) { if (frame.ReadSubrecordFrame().Content.Length != 0) { throw new ArgumentException($"Marker had unexpected length."); } return(lastParsed); }
public static partial void FillBinaryUnusedConditionsLogicCustom(MutagenFrame frame, IQuestInternal item) { var nextHeader = frame.ReadSubrecordFrame(); if (nextHeader.RecordType != RecordTypes.NEXT || nextHeader.Content.Length != 0) { throw new ArgumentException("Unexpected NEXT header"); } ConditionBinaryCreateTranslation.FillConditionsList(item.UnusedConditions, frame); }
public static void FillBinaryDisabledCloudLayers(MutagenFrame frame, CloudLayer[] clouds) { var subRec = frame.ReadSubrecordFrame(); var raw = BinaryPrimitives.ReadUInt32LittleEndian(subRec.Content); uint index = 1; for (int i = 0; i < NumLayers; i++) { // Inverse because we're exposing as enabled clouds[i].Enabled = !EnumExt.HasFlag(raw, index); index <<= 1; } }
public static partial void FillBinaryZoomCustom(MutagenFrame frame, ICameraPathInternal item) { var subFrame = frame.ReadSubrecordFrame(); if (subFrame.Content.Length != 1) { throw new ArgumentException(); } var e = subFrame.Content[0]; item.Zoom = (CameraPath.ZoomType)(e % 128); item.ZoomMustHaveCameraShots = e < 128; }
public static partial ParseResult FillBinaryTrapFormCustom(MutagenFrame frame, IAPlacedTrapInternal item) { var subRec = frame.ReadSubrecordFrame(); if (subRec.Content.Length != 4) { throw new ArgumentException("Unexpected length"); } var form = FormKeyBinaryTranslation.Instance.Parse(subRec.Content, frame.MetaData.MasterReferences !); switch (item) { case IPlacedArrow arrow: arrow.Projectile.FormKey = form; break; case IPlacedBeam beam: beam.Projectile.FormKey = form; break; case IPlacedFlame flame: flame.Projectile.FormKey = form; break; case IPlacedCone cone: cone.Projectile.FormKey = form; break; case IPlacedBarrier barrier: barrier.Projectile.FormKey = form; break; case IPlacedTrap trap: trap.Projectile.FormKey = form; break; case IPlacedHazard hazard: hazard.Hazard.FormKey = form; break; case IPlacedMissile missile: missile.Projectile.FormKey = form; break; default: throw new NotImplementedException(); } return(null); }
static partial void FillBinaryPackageTemplateCustom(MutagenFrame frame, IPackageInternal item) { var pkcuRecord = frame.ReadSubrecordFrame(); if (pkcuRecord.Content.Length != 12) { throw new ArgumentException(); } var dataCount = checked ((int)BinaryPrimitives.ReadUInt32LittleEndian(pkcuRecord.Content)); item.PackageTemplate.FormKey = FormKeyBinaryTranslation.Instance.Parse(pkcuRecord.Content.Slice(4, 4), frame.MetaData.MasterReferences !); item.DataInputVersion = BinaryPrimitives.ReadInt32LittleEndian(pkcuRecord.Content.Slice(8)); FillPackageData(frame.Reader, dataCount, item.Data); }
public static partial void FillBinaryAliasIndexCustom(MutagenFrame frame, IFindMatchingRefNearAlias item) { var subrecord = frame.ReadSubrecordFrame(); item.AliasIndex = checked ((short)BinaryPrimitives.ReadInt32LittleEndian(subrecord.Content)); }
public static partial void FillBinaryDataMarkerCustom(MutagenFrame frame, INpcInternal item) { // Skip marker frame.ReadSubrecordFrame(); }
public static partial void FillBinaryResponseCountCustom(MutagenFrame frame, IDialogTopicInternal item) { // Skip counter frame.ReadSubrecordFrame(); }
static partial void FillBinaryCompletionConditionsCustom(MutagenFrame frame, IScenePhase item) { frame.ReadSubrecordFrame(); ConditionBinaryCreateTranslation.FillConditionsList(item.CompletionConditions, frame); }
public static partial ParseResult FillBinaryResponseCountCustom(MutagenFrame frame, IDialogTopicInternal item) { // Skip counter frame.ReadSubrecordFrame(); return(null); }
public static partial void FillBinaryNextAliasIDCustom(MutagenFrame frame, IQuestInternal item) { // Skip frame.ReadSubrecordFrame(); }
public static partial void FillBinaryAnimationCountCustom(MutagenFrame frame, IIdleMarkerInternal item) { // Skip. Don't care frame.ReadSubrecordFrame(); }
static partial void FillBinaryEndCustom(MutagenFrame frame, IQuestAlias item) { // Skip frame.ReadSubrecordFrame(); }
public static partial ParseResult FillBinaryDataMarkerCustom(MutagenFrame frame, INpcInternal item) { // Skip marker frame.ReadSubrecordFrame(); return(null); }
public static partial void FillBinaryDataCustom(MutagenFrame frame, IGameSettingBoolInternal item) { var subFrame = frame.ReadSubrecordFrame(); item.Data = (bool)(BinaryPrimitives.ReadUInt32LittleEndian(subFrame.Content) != 0); }
public static partial ParseResult FillBinaryNextAliasIDCustom(MutagenFrame frame, IQuestInternal item) { // Skip frame.ReadSubrecordFrame(); return(null); }
public static partial ParseResult FillBinaryEndCustom(MutagenFrame frame, IQuestAlias item, PreviousParse lastParsed) { // Skip frame.ReadSubrecordFrame(); return(lastParsed); }
public static partial ParseResult FillBinaryAnimationCountCustom(MutagenFrame frame, IIdleMarkerInternal item) { // Skip. Don't care frame.ReadSubrecordFrame(); return null; }