diff --git a/Mutagen.Bethesda.Starfield/Documentation/AspectInterfaceDocumentation_Generated.md b/Mutagen.Bethesda.Starfield/Documentation/AspectInterfaceDocumentation_Generated.md index ceca75d02..a5bc1a843 100644 --- a/Mutagen.Bethesda.Starfield/Documentation/AspectInterfaceDocumentation_Generated.md +++ b/Mutagen.Bethesda.Starfield/Documentation/AspectInterfaceDocumentation_Generated.md @@ -7,6 +7,7 @@ Functions can then be written that take in `INamed`, allowing any record that ha - Activator - APlacedTrap - Armor +- BiomeMarker - Book - Container - DialogResponses @@ -47,6 +48,7 @@ Functions can then be written that take in `INamed`, allowing any record that ha - Activator - Ammunition - Armor +- BiomeMarker - Book - Container - Flora @@ -78,6 +80,7 @@ Functions can then be written that take in `INamed`, allowing any record that ha - AnimatedObject - AObjectModification - ArmorModification +- BiomeMarker - BodyData - Book - Container @@ -215,6 +218,7 @@ Functions can then be written that take in `INamed`, allowing any record that ha - Armor - AudioOcclusionPrimitive - BendableSpline +- BiomeMarker - Book - Container - Flora @@ -264,6 +268,7 @@ Functions can then be written that take in `INamed`, allowing any record that ha - Activator - APlacedTrap - Armor +- BiomeMarker - Book - Container - Flora @@ -345,6 +350,12 @@ Functions can then be written that take in `INamed`, allowing any record that ha - IObjectBounded ### BendableSpline - IObjectBounded +### BiomeMarker +- IHaveVirtualMachineAdapter +- IKeyworded +- IModeled +- IObjectBounded +- IScripted ### BipedObjectData - INamed ### BlueprintComponentBODSItem diff --git a/Mutagen.Bethesda.Starfield/Interfaces/Aspect/AspectInterfaceMapping_Generated.cs b/Mutagen.Bethesda.Starfield/Interfaces/Aspect/AspectInterfaceMapping_Generated.cs index a38837b0f..319b2e462 100644 --- a/Mutagen.Bethesda.Starfield/Interfaces/Aspect/AspectInterfaceMapping_Generated.cs +++ b/Mutagen.Bethesda.Starfield/Interfaces/Aspect/AspectInterfaceMapping_Generated.cs @@ -25,6 +25,7 @@ public StarfieldAspectInterfaceMapping() Activator_Registration.Instance, APlacedTrap_Registration.Instance, Armor_Registration.Instance, + BiomeMarker_Registration.Instance, Book_Registration.Instance, Container_Registration.Instance, DialogResponses_Registration.Instance, @@ -70,6 +71,7 @@ public StarfieldAspectInterfaceMapping() Activator_Registration.Instance, Ammunition_Registration.Instance, Armor_Registration.Instance, + BiomeMarker_Registration.Instance, Book_Registration.Instance, Container_Registration.Instance, Flora_Registration.Instance, @@ -104,6 +106,7 @@ public StarfieldAspectInterfaceMapping() AnimatedObject_Registration.Instance, AObjectModification_Registration.Instance, ArmorModification_Registration.Instance, + BiomeMarker_Registration.Instance, BodyData_Registration.Instance, Book_Registration.Instance, Container_Registration.Instance, @@ -419,6 +422,7 @@ public StarfieldAspectInterfaceMapping() Ammunition_Registration.Instance, Armor_Registration.Instance, AudioOcclusionPrimitive_Registration.Instance, + BiomeMarker_Registration.Instance, Book_Registration.Instance, Container_Registration.Instance, Flora_Registration.Instance, @@ -479,6 +483,7 @@ public StarfieldAspectInterfaceMapping() Activator_Registration.Instance, APlacedTrap_Registration.Instance, Armor_Registration.Instance, + BiomeMarker_Registration.Instance, Book_Registration.Instance, Container_Registration.Instance, Flora_Registration.Instance, diff --git a/Mutagen.Bethesda.Starfield/Records/Major Records/BiomeMarker.xml b/Mutagen.Bethesda.Starfield/Records/Major Records/BiomeMarker.xml index 52b5acca5..9de34eb17 100644 --- a/Mutagen.Bethesda.Starfield/Records/Major Records/BiomeMarker.xml +++ b/Mutagen.Bethesda.Starfield/Records/Major Records/BiomeMarker.xml @@ -2,6 +2,18 @@ + + + + + + + + + + + + INpcTemplateTarget diff --git a/Mutagen.Bethesda.Starfield/Records/Major Records/BiomeMarker_Generated.cs b/Mutagen.Bethesda.Starfield/Records/Major Records/BiomeMarker_Generated.cs index a46db8177..0872700f0 100644 --- a/Mutagen.Bethesda.Starfield/Records/Major Records/BiomeMarker_Generated.cs +++ b/Mutagen.Bethesda.Starfield/Records/Major Records/BiomeMarker_Generated.cs @@ -7,12 +7,16 @@ using Loqui; using Loqui.Interfaces; using Loqui.Internal; +using Mutagen.Bethesda.Assets; using Mutagen.Bethesda.Binary; using Mutagen.Bethesda.Plugins; +using Mutagen.Bethesda.Plugins.Aspects; +using Mutagen.Bethesda.Plugins.Assets; using Mutagen.Bethesda.Plugins.Binary.Headers; using Mutagen.Bethesda.Plugins.Binary.Overlay; using Mutagen.Bethesda.Plugins.Binary.Streams; using Mutagen.Bethesda.Plugins.Binary.Translations; +using Mutagen.Bethesda.Plugins.Cache; using Mutagen.Bethesda.Plugins.Exceptions; using Mutagen.Bethesda.Plugins.Internals; using Mutagen.Bethesda.Plugins.Meta; @@ -54,6 +58,144 @@ protected BiomeMarker() partial void CustomCtor(); #endregion + #region VirtualMachineAdapter + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private VirtualMachineAdapter? _VirtualMachineAdapter; + /// + /// Aspects: IScripted + /// + public VirtualMachineAdapter? VirtualMachineAdapter + { + get => _VirtualMachineAdapter; + set => _VirtualMachineAdapter = value; + } + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + IVirtualMachineAdapterGetter? IBiomeMarkerGetter.VirtualMachineAdapter => this.VirtualMachineAdapter; + #region Aspects + IAVirtualMachineAdapterGetter? IHaveVirtualMachineAdapterGetter.VirtualMachineAdapter => this.VirtualMachineAdapter; + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + IVirtualMachineAdapterGetter? IScriptedGetter.VirtualMachineAdapter => this.VirtualMachineAdapter; + #endregion + #endregion + #region ObjectBounds + /// + /// Aspects: IObjectBounded + /// + public ObjectBounds ObjectBounds { get; set; } = new ObjectBounds(); + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + IObjectBoundsGetter IBiomeMarkerGetter.ObjectBounds => ObjectBounds; + #region Aspects + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + ObjectBounds? IObjectBoundedOptional.ObjectBounds + { + get => this.ObjectBounds; + set => this.ObjectBounds = value ?? new ObjectBounds(); + } + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + IObjectBoundsGetter IObjectBoundedGetter.ObjectBounds => this.ObjectBounds; + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + IObjectBoundsGetter? IObjectBoundedOptionalGetter.ObjectBounds => this.ObjectBounds; + #endregion + #endregion + #region ODTY + public Single? ODTY { get; set; } + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + Single? IBiomeMarkerGetter.ODTY => this.ODTY; + #endregion + #region ObjectPlacementDefaults + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private ObjectPlacementDefaults? _ObjectPlacementDefaults; + public ObjectPlacementDefaults? ObjectPlacementDefaults + { + get => _ObjectPlacementDefaults; + set => _ObjectPlacementDefaults = value; + } + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + IObjectPlacementDefaultsGetter? IBiomeMarkerGetter.ObjectPlacementDefaults => this.ObjectPlacementDefaults; + #endregion + #region Model + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private Model? _Model; + /// + /// Aspects: IModeled + /// + public Model? Model + { + get => _Model; + set => _Model = value; + } + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + IModelGetter? IBiomeMarkerGetter.Model => this.Model; + #region Aspects + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + IModelGetter? IModeledGetter.Model => this.Model; + #endregion + #endregion + #region Keywords + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private ExtendedList>? _Keywords; + /// + /// Aspects: IKeyworded<IKeywordGetter> + /// + public ExtendedList>? Keywords + { + get => this._Keywords; + set => this._Keywords = value; + } + #region Interface Members + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + IReadOnlyList>? IBiomeMarkerGetter.Keywords => _Keywords; + #endregion + + #region Aspects + IReadOnlyList>? IKeywordedGetter.Keywords => this.Keywords; + IReadOnlyList>? IKeywordedGetter.Keywords => this.Keywords; + #endregion + #endregion + #region Conditions + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private ExtendedList _Conditions = new ExtendedList(); + public ExtendedList Conditions + { + get => this._Conditions; + init => this._Conditions = value; + } + #region Interface Members + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + IReadOnlyList IBiomeMarkerGetter.Conditions => _Conditions; + #endregion + + #endregion + #region MarkerType + private readonly IFormLink _MarkerType = new FormLink(); + public IFormLink MarkerType + { + get => _MarkerType; + set => _MarkerType.SetTo(value); + } + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + IFormLinkGetter IBiomeMarkerGetter.MarkerType => this.MarkerType; + #endregion + #region FloraList + private readonly IFormLink _FloraList = new FormLink(); + public IFormLink FloraList + { + get => _FloraList; + set => _FloraList.SetTo(value); + } + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + IFormLinkGetter IBiomeMarkerGetter.FloraList => this.FloraList; + #endregion + #region LNA2 + private readonly IFormLink _LNA2 = new FormLink(); + public IFormLink LNA2 + { + get => _LNA2; + set => _LNA2.SetTo(value); + } + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + IFormLinkGetter IBiomeMarkerGetter.LNA2 => this.LNA2; + #endregion #region To String @@ -79,6 +221,16 @@ public override void Print( public Mask(TItem initialValue) : base(initialValue) { + this.VirtualMachineAdapter = new MaskItem?>(initialValue, new VirtualMachineAdapter.Mask(initialValue)); + this.ObjectBounds = new MaskItem?>(initialValue, new ObjectBounds.Mask(initialValue)); + this.ODTY = initialValue; + this.ObjectPlacementDefaults = new MaskItem?>(initialValue, new ObjectPlacementDefaults.Mask(initialValue)); + this.Model = new MaskItem?>(initialValue, new Model.Mask(initialValue)); + this.Keywords = new MaskItem?>(initialValue, Enumerable.Empty<(int Index, TItem Value)>()); + this.Conditions = new MaskItem?>>?>(initialValue, Enumerable.Empty?>>()); + this.MarkerType = initialValue; + this.FloraList = initialValue; + this.LNA2 = initialValue; } public Mask( @@ -88,7 +240,17 @@ public Mask( TItem EditorID, TItem FormVersion, TItem Version2, - TItem StarfieldMajorRecordFlags) + TItem StarfieldMajorRecordFlags, + TItem VirtualMachineAdapter, + TItem ObjectBounds, + TItem ODTY, + TItem ObjectPlacementDefaults, + TItem Model, + TItem Keywords, + TItem Conditions, + TItem MarkerType, + TItem FloraList, + TItem LNA2) : base( MajorRecordFlagsRaw: MajorRecordFlagsRaw, FormKey: FormKey, @@ -98,6 +260,16 @@ public Mask( Version2: Version2, StarfieldMajorRecordFlags: StarfieldMajorRecordFlags) { + this.VirtualMachineAdapter = new MaskItem?>(VirtualMachineAdapter, new VirtualMachineAdapter.Mask(VirtualMachineAdapter)); + this.ObjectBounds = new MaskItem?>(ObjectBounds, new ObjectBounds.Mask(ObjectBounds)); + this.ODTY = ODTY; + this.ObjectPlacementDefaults = new MaskItem?>(ObjectPlacementDefaults, new ObjectPlacementDefaults.Mask(ObjectPlacementDefaults)); + this.Model = new MaskItem?>(Model, new Model.Mask(Model)); + this.Keywords = new MaskItem?>(Keywords, Enumerable.Empty<(int Index, TItem Value)>()); + this.Conditions = new MaskItem?>>?>(Conditions, Enumerable.Empty?>>()); + this.MarkerType = MarkerType; + this.FloraList = FloraList; + this.LNA2 = LNA2; } #pragma warning disable CS8618 @@ -108,6 +280,19 @@ protected Mask() #endregion + #region Members + public MaskItem?>? VirtualMachineAdapter { get; set; } + public MaskItem?>? ObjectBounds { get; set; } + public TItem ODTY; + public MaskItem?>? ObjectPlacementDefaults { get; set; } + public MaskItem?>? Model { get; set; } + public MaskItem?>? Keywords; + public MaskItem?>>?>? Conditions; + public TItem MarkerType; + public TItem FloraList; + public TItem LNA2; + #endregion + #region Equals public override bool Equals(object? obj) { @@ -119,11 +304,31 @@ public bool Equals(Mask? rhs) { if (rhs == null) return false; if (!base.Equals(rhs)) return false; + if (!object.Equals(this.VirtualMachineAdapter, rhs.VirtualMachineAdapter)) return false; + if (!object.Equals(this.ObjectBounds, rhs.ObjectBounds)) return false; + if (!object.Equals(this.ODTY, rhs.ODTY)) return false; + if (!object.Equals(this.ObjectPlacementDefaults, rhs.ObjectPlacementDefaults)) return false; + if (!object.Equals(this.Model, rhs.Model)) return false; + if (!object.Equals(this.Keywords, rhs.Keywords)) return false; + if (!object.Equals(this.Conditions, rhs.Conditions)) return false; + if (!object.Equals(this.MarkerType, rhs.MarkerType)) return false; + if (!object.Equals(this.FloraList, rhs.FloraList)) return false; + if (!object.Equals(this.LNA2, rhs.LNA2)) return false; return true; } public override int GetHashCode() { var hash = new HashCode(); + hash.Add(this.VirtualMachineAdapter); + hash.Add(this.ObjectBounds); + hash.Add(this.ODTY); + hash.Add(this.ObjectPlacementDefaults); + hash.Add(this.Model); + hash.Add(this.Keywords); + hash.Add(this.Conditions); + hash.Add(this.MarkerType); + hash.Add(this.FloraList); + hash.Add(this.LNA2); hash.Add(base.GetHashCode()); return hash.ToHashCode(); } @@ -134,6 +339,53 @@ public override int GetHashCode() public override bool All(Func eval) { if (!base.All(eval)) return false; + if (VirtualMachineAdapter != null) + { + if (!eval(this.VirtualMachineAdapter.Overall)) return false; + if (this.VirtualMachineAdapter.Specific != null && !this.VirtualMachineAdapter.Specific.All(eval)) return false; + } + if (ObjectBounds != null) + { + if (!eval(this.ObjectBounds.Overall)) return false; + if (this.ObjectBounds.Specific != null && !this.ObjectBounds.Specific.All(eval)) return false; + } + if (!eval(this.ODTY)) return false; + if (ObjectPlacementDefaults != null) + { + if (!eval(this.ObjectPlacementDefaults.Overall)) return false; + if (this.ObjectPlacementDefaults.Specific != null && !this.ObjectPlacementDefaults.Specific.All(eval)) return false; + } + if (Model != null) + { + if (!eval(this.Model.Overall)) return false; + if (this.Model.Specific != null && !this.Model.Specific.All(eval)) return false; + } + if (this.Keywords != null) + { + if (!eval(this.Keywords.Overall)) return false; + if (this.Keywords.Specific != null) + { + foreach (var item in this.Keywords.Specific) + { + if (!eval(item.Value)) return false; + } + } + } + if (this.Conditions != null) + { + if (!eval(this.Conditions.Overall)) return false; + if (this.Conditions.Specific != null) + { + foreach (var item in this.Conditions.Specific) + { + if (!eval(item.Overall)) return false; + if (item.Specific != null && !item.Specific.All(eval)) return false; + } + } + } + if (!eval(this.MarkerType)) return false; + if (!eval(this.FloraList)) return false; + if (!eval(this.LNA2)) return false; return true; } #endregion @@ -142,6 +394,53 @@ public override bool All(Func eval) public override bool Any(Func eval) { if (base.Any(eval)) return true; + if (VirtualMachineAdapter != null) + { + if (eval(this.VirtualMachineAdapter.Overall)) return true; + if (this.VirtualMachineAdapter.Specific != null && this.VirtualMachineAdapter.Specific.Any(eval)) return true; + } + if (ObjectBounds != null) + { + if (eval(this.ObjectBounds.Overall)) return true; + if (this.ObjectBounds.Specific != null && this.ObjectBounds.Specific.Any(eval)) return true; + } + if (eval(this.ODTY)) return true; + if (ObjectPlacementDefaults != null) + { + if (eval(this.ObjectPlacementDefaults.Overall)) return true; + if (this.ObjectPlacementDefaults.Specific != null && this.ObjectPlacementDefaults.Specific.Any(eval)) return true; + } + if (Model != null) + { + if (eval(this.Model.Overall)) return true; + if (this.Model.Specific != null && this.Model.Specific.Any(eval)) return true; + } + if (this.Keywords != null) + { + if (eval(this.Keywords.Overall)) return true; + if (this.Keywords.Specific != null) + { + foreach (var item in this.Keywords.Specific) + { + if (!eval(item.Value)) return false; + } + } + } + if (this.Conditions != null) + { + if (eval(this.Conditions.Overall)) return true; + if (this.Conditions.Specific != null) + { + foreach (var item in this.Conditions.Specific) + { + if (!eval(item.Overall)) return false; + if (item.Specific != null && !item.Specific.All(eval)) return false; + } + } + } + if (eval(this.MarkerType)) return true; + if (eval(this.FloraList)) return true; + if (eval(this.LNA2)) return true; return false; } #endregion @@ -157,6 +456,43 @@ public override bool Any(Func eval) protected void Translate_InternalFill(Mask obj, Func eval) { base.Translate_InternalFill(obj, eval); + obj.VirtualMachineAdapter = this.VirtualMachineAdapter == null ? null : new MaskItem?>(eval(this.VirtualMachineAdapter.Overall), this.VirtualMachineAdapter.Specific?.Translate(eval)); + obj.ObjectBounds = this.ObjectBounds == null ? null : new MaskItem?>(eval(this.ObjectBounds.Overall), this.ObjectBounds.Specific?.Translate(eval)); + obj.ODTY = eval(this.ODTY); + obj.ObjectPlacementDefaults = this.ObjectPlacementDefaults == null ? null : new MaskItem?>(eval(this.ObjectPlacementDefaults.Overall), this.ObjectPlacementDefaults.Specific?.Translate(eval)); + obj.Model = this.Model == null ? null : new MaskItem?>(eval(this.Model.Overall), this.Model.Specific?.Translate(eval)); + if (Keywords != null) + { + obj.Keywords = new MaskItem?>(eval(this.Keywords.Overall), Enumerable.Empty<(int Index, R Value)>()); + if (Keywords.Specific != null) + { + var l = new List<(int Index, R Item)>(); + obj.Keywords.Specific = l; + foreach (var item in Keywords.Specific) + { + R mask = eval(item.Value); + l.Add((item.Index, mask)); + } + } + } + if (Conditions != null) + { + obj.Conditions = new MaskItem?>>?>(eval(this.Conditions.Overall), Enumerable.Empty?>>()); + if (Conditions.Specific != null) + { + var l = new List?>>(); + obj.Conditions.Specific = l; + foreach (var item in Conditions.Specific) + { + MaskItemIndexed?>? mask = item == null ? null : new MaskItemIndexed?>(item.Index, eval(item.Overall), item.Specific?.Translate(eval)); + if (mask == null) continue; + l.Add(mask); + } + } + } + obj.MarkerType = eval(this.MarkerType); + obj.FloraList = eval(this.FloraList); + obj.LNA2 = eval(this.LNA2); } #endregion @@ -175,6 +511,78 @@ public void Print(StructuredStringBuilder sb, BiomeMarker.Mask? printMask sb.AppendLine($"{nameof(BiomeMarker.Mask)} =>"); using (sb.Brace()) { + if (printMask?.VirtualMachineAdapter?.Overall ?? true) + { + VirtualMachineAdapter?.Print(sb); + } + if (printMask?.ObjectBounds?.Overall ?? true) + { + ObjectBounds?.Print(sb); + } + if (printMask?.ODTY ?? true) + { + sb.AppendItem(ODTY, "ODTY"); + } + if (printMask?.ObjectPlacementDefaults?.Overall ?? true) + { + ObjectPlacementDefaults?.Print(sb); + } + if (printMask?.Model?.Overall ?? true) + { + Model?.Print(sb); + } + if ((printMask?.Keywords?.Overall ?? true) + && Keywords is {} KeywordsItem) + { + sb.AppendLine("Keywords =>"); + using (sb.Brace()) + { + sb.AppendItem(KeywordsItem.Overall); + if (KeywordsItem.Specific != null) + { + foreach (var subItem in KeywordsItem.Specific) + { + using (sb.Brace()) + { + { + sb.AppendItem(subItem); + } + } + } + } + } + } + if ((printMask?.Conditions?.Overall ?? true) + && Conditions is {} ConditionsItem) + { + sb.AppendLine("Conditions =>"); + using (sb.Brace()) + { + sb.AppendItem(ConditionsItem.Overall); + if (ConditionsItem.Specific != null) + { + foreach (var subItem in ConditionsItem.Specific) + { + using (sb.Brace()) + { + subItem?.Print(sb); + } + } + } + } + } + if (printMask?.MarkerType ?? true) + { + sb.AppendItem(MarkerType, "MarkerType"); + } + if (printMask?.FloraList ?? true) + { + sb.AppendItem(FloraList, "FloraList"); + } + if (printMask?.LNA2 ?? true) + { + sb.AppendItem(LNA2, "LNA2"); + } } } #endregion @@ -185,12 +593,45 @@ public void Print(StructuredStringBuilder sb, BiomeMarker.Mask? printMask StarfieldMajorRecord.ErrorMask, IErrorMask { + #region Members + public MaskItem? VirtualMachineAdapter; + public MaskItem? ObjectBounds; + public Exception? ODTY; + public MaskItem? ObjectPlacementDefaults; + public MaskItem? Model; + public MaskItem?>? Keywords; + public MaskItem>?>? Conditions; + public Exception? MarkerType; + public Exception? FloraList; + public Exception? LNA2; + #endregion + #region IErrorMask public override object? GetNthMask(int index) { BiomeMarker_FieldIndex enu = (BiomeMarker_FieldIndex)index; switch (enu) { + case BiomeMarker_FieldIndex.VirtualMachineAdapter: + return VirtualMachineAdapter; + case BiomeMarker_FieldIndex.ObjectBounds: + return ObjectBounds; + case BiomeMarker_FieldIndex.ODTY: + return ODTY; + case BiomeMarker_FieldIndex.ObjectPlacementDefaults: + return ObjectPlacementDefaults; + case BiomeMarker_FieldIndex.Model: + return Model; + case BiomeMarker_FieldIndex.Keywords: + return Keywords; + case BiomeMarker_FieldIndex.Conditions: + return Conditions; + case BiomeMarker_FieldIndex.MarkerType: + return MarkerType; + case BiomeMarker_FieldIndex.FloraList: + return FloraList; + case BiomeMarker_FieldIndex.LNA2: + return LNA2; default: return base.GetNthMask(index); } @@ -201,6 +642,36 @@ public override void SetNthException(int index, Exception ex) BiomeMarker_FieldIndex enu = (BiomeMarker_FieldIndex)index; switch (enu) { + case BiomeMarker_FieldIndex.VirtualMachineAdapter: + this.VirtualMachineAdapter = new MaskItem(ex, null); + break; + case BiomeMarker_FieldIndex.ObjectBounds: + this.ObjectBounds = new MaskItem(ex, null); + break; + case BiomeMarker_FieldIndex.ODTY: + this.ODTY = ex; + break; + case BiomeMarker_FieldIndex.ObjectPlacementDefaults: + this.ObjectPlacementDefaults = new MaskItem(ex, null); + break; + case BiomeMarker_FieldIndex.Model: + this.Model = new MaskItem(ex, null); + break; + case BiomeMarker_FieldIndex.Keywords: + this.Keywords = new MaskItem?>(ex, null); + break; + case BiomeMarker_FieldIndex.Conditions: + this.Conditions = new MaskItem>?>(ex, null); + break; + case BiomeMarker_FieldIndex.MarkerType: + this.MarkerType = ex; + break; + case BiomeMarker_FieldIndex.FloraList: + this.FloraList = ex; + break; + case BiomeMarker_FieldIndex.LNA2: + this.LNA2 = ex; + break; default: base.SetNthException(index, ex); break; @@ -212,6 +683,36 @@ public override void SetNthMask(int index, object obj) BiomeMarker_FieldIndex enu = (BiomeMarker_FieldIndex)index; switch (enu) { + case BiomeMarker_FieldIndex.VirtualMachineAdapter: + this.VirtualMachineAdapter = (MaskItem?)obj; + break; + case BiomeMarker_FieldIndex.ObjectBounds: + this.ObjectBounds = (MaskItem?)obj; + break; + case BiomeMarker_FieldIndex.ODTY: + this.ODTY = (Exception?)obj; + break; + case BiomeMarker_FieldIndex.ObjectPlacementDefaults: + this.ObjectPlacementDefaults = (MaskItem?)obj; + break; + case BiomeMarker_FieldIndex.Model: + this.Model = (MaskItem?)obj; + break; + case BiomeMarker_FieldIndex.Keywords: + this.Keywords = (MaskItem?>)obj; + break; + case BiomeMarker_FieldIndex.Conditions: + this.Conditions = (MaskItem>?>)obj; + break; + case BiomeMarker_FieldIndex.MarkerType: + this.MarkerType = (Exception?)obj; + break; + case BiomeMarker_FieldIndex.FloraList: + this.FloraList = (Exception?)obj; + break; + case BiomeMarker_FieldIndex.LNA2: + this.LNA2 = (Exception?)obj; + break; default: base.SetNthMask(index, obj); break; @@ -221,6 +722,16 @@ public override void SetNthMask(int index, object obj) public override bool IsInError() { if (Overall != null) return true; + if (VirtualMachineAdapter != null) return true; + if (ObjectBounds != null) return true; + if (ODTY != null) return true; + if (ObjectPlacementDefaults != null) return true; + if (Model != null) return true; + if (Keywords != null) return true; + if (Conditions != null) return true; + if (MarkerType != null) return true; + if (FloraList != null) return true; + if (LNA2 != null) return true; return false; } #endregion @@ -247,6 +758,60 @@ public override void Print(StructuredStringBuilder sb, string? name = null) protected override void PrintFillInternal(StructuredStringBuilder sb) { base.PrintFillInternal(sb); + VirtualMachineAdapter?.Print(sb); + ObjectBounds?.Print(sb); + { + sb.AppendItem(ODTY, "ODTY"); + } + ObjectPlacementDefaults?.Print(sb); + Model?.Print(sb); + if (Keywords is {} KeywordsItem) + { + sb.AppendLine("Keywords =>"); + using (sb.Brace()) + { + sb.AppendItem(KeywordsItem.Overall); + if (KeywordsItem.Specific != null) + { + foreach (var subItem in KeywordsItem.Specific) + { + using (sb.Brace()) + { + { + sb.AppendItem(subItem); + } + } + } + } + } + } + if (Conditions is {} ConditionsItem) + { + sb.AppendLine("Conditions =>"); + using (sb.Brace()) + { + sb.AppendItem(ConditionsItem.Overall); + if (ConditionsItem.Specific != null) + { + foreach (var subItem in ConditionsItem.Specific) + { + using (sb.Brace()) + { + subItem?.Print(sb); + } + } + } + } + } + { + sb.AppendItem(MarkerType, "MarkerType"); + } + { + sb.AppendItem(FloraList, "FloraList"); + } + { + sb.AppendItem(LNA2, "LNA2"); + } } #endregion @@ -255,6 +820,16 @@ public ErrorMask Combine(ErrorMask? rhs) { if (rhs == null) return this; var ret = new ErrorMask(); + ret.VirtualMachineAdapter = this.VirtualMachineAdapter.Combine(rhs.VirtualMachineAdapter, (l, r) => l.Combine(r)); + ret.ObjectBounds = this.ObjectBounds.Combine(rhs.ObjectBounds, (l, r) => l.Combine(r)); + ret.ODTY = this.ODTY.Combine(rhs.ODTY); + ret.ObjectPlacementDefaults = this.ObjectPlacementDefaults.Combine(rhs.ObjectPlacementDefaults, (l, r) => l.Combine(r)); + ret.Model = this.Model.Combine(rhs.Model, (l, r) => l.Combine(r)); + ret.Keywords = new MaskItem?>(Noggog.ExceptionExt.Combine(this.Keywords?.Overall, rhs.Keywords?.Overall), Noggog.ExceptionExt.Combine(this.Keywords?.Specific, rhs.Keywords?.Specific)); + ret.Conditions = new MaskItem>?>(Noggog.ExceptionExt.Combine(this.Conditions?.Overall, rhs.Conditions?.Overall), Noggog.ExceptionExt.Combine(this.Conditions?.Specific, rhs.Conditions?.Specific)); + ret.MarkerType = this.MarkerType.Combine(rhs.MarkerType); + ret.FloraList = this.FloraList.Combine(rhs.FloraList); + ret.LNA2 = this.LNA2.Combine(rhs.LNA2); return ret; } public static ErrorMask? Combine(ErrorMask? lhs, ErrorMask? rhs) @@ -276,16 +851,49 @@ public ErrorMask Combine(ErrorMask? rhs) StarfieldMajorRecord.TranslationMask, ITranslationMask { + #region Members + public VirtualMachineAdapter.TranslationMask? VirtualMachineAdapter; + public ObjectBounds.TranslationMask? ObjectBounds; + public bool ODTY; + public ObjectPlacementDefaults.TranslationMask? ObjectPlacementDefaults; + public Model.TranslationMask? Model; + public bool Keywords; + public Condition.TranslationMask? Conditions; + public bool MarkerType; + public bool FloraList; + public bool LNA2; + #endregion + #region Ctors public TranslationMask( bool defaultOn, bool onOverall = true) : base(defaultOn, onOverall) { + this.ODTY = defaultOn; + this.Keywords = defaultOn; + this.MarkerType = defaultOn; + this.FloraList = defaultOn; + this.LNA2 = defaultOn; } #endregion + protected override void GetCrystal(List<(bool On, TranslationCrystal? SubCrystal)> ret) + { + base.GetCrystal(ret); + ret.Add((VirtualMachineAdapter != null ? VirtualMachineAdapter.OnOverall : DefaultOn, VirtualMachineAdapter?.GetCrystal())); + ret.Add((ObjectBounds != null ? ObjectBounds.OnOverall : DefaultOn, ObjectBounds?.GetCrystal())); + ret.Add((ODTY, null)); + ret.Add((ObjectPlacementDefaults != null ? ObjectPlacementDefaults.OnOverall : DefaultOn, ObjectPlacementDefaults?.GetCrystal())); + ret.Add((Model != null ? Model.OnOverall : DefaultOn, Model?.GetCrystal())); + ret.Add((Keywords, null)); + ret.Add((Conditions == null ? DefaultOn : !Conditions.GetCrystal().CopyNothing, Conditions?.GetCrystal())); + ret.Add((MarkerType, null)); + ret.Add((FloraList, null)); + ret.Add((LNA2, null)); + } + public static implicit operator TranslationMask(bool defaultOn) { return new TranslationMask(defaultOn: defaultOn, onOverall: defaultOn); @@ -296,6 +904,8 @@ public static implicit operator TranslationMask(bool defaultOn) #region Mutagen public static readonly RecordType GrupRecordType = BiomeMarker_Registration.TriggeringRecordType; + public override IEnumerable EnumerateFormLinks() => BiomeMarkerCommon.Instance.EnumerateFormLinks(this); + public override void RemapLinks(IReadOnlyDictionary mapping) => BiomeMarkerSetterCommon.Instance.RemapLinks(this, mapping); public BiomeMarker( FormKey formKey, StarfieldRelease gameRelease) @@ -345,6 +955,10 @@ public override string ToString() protected override Type LinkType => typeof(IBiomeMarker); + public override IEnumerable EnumerateAssetLinks(AssetLinkQuery queryCategories, IAssetLinkCache? linkCache, Type? assetType) => BiomeMarkerCommon.Instance.EnumerateAssetLinks(this, queryCategories, linkCache, assetType); + public override IEnumerable EnumerateListedAssetLinks() => BiomeMarkerSetterCommon.Instance.EnumerateListedAssetLinks(this); + public override void RemapAssetLinks(IReadOnlyDictionary mapping, AssetLinkQuery queryCategories, IAssetLinkCache? linkCache) => BiomeMarkerSetterCommon.Instance.RemapAssetLinks(this, mapping, linkCache, queryCategories); + public override void RemapListedAssetLinks(IReadOnlyDictionary mapping) => BiomeMarkerSetterCommon.Instance.RemapAssetLinks(this, mapping, null, AssetLinkQuery.Listed); #region Equals and Hash public override bool Equals(object? obj) { @@ -424,11 +1038,39 @@ void IClearable.Clear() #region Interface public partial interface IBiomeMarker : + IAssetLinkContainer, IBiomeMarkerGetter, + IFormLinkContainer, + IKeyworded, ILoquiObjectSetter, + IModeled, INpcTemplateTarget, + IObjectBounded, + IScripted, IStarfieldMajorRecordInternal { + /// + /// Aspects: IScripted + /// + new VirtualMachineAdapter? VirtualMachineAdapter { get; set; } + /// + /// Aspects: IObjectBounded + /// + new ObjectBounds ObjectBounds { get; set; } + new Single? ODTY { get; set; } + new ObjectPlacementDefaults? ObjectPlacementDefaults { get; set; } + /// + /// Aspects: IModeled + /// + new Model? Model { get; set; } + /// + /// Aspects: IKeyworded<IKeywordGetter> + /// + new ExtendedList>? Keywords { get; set; } + new ExtendedList Conditions { get; } + new IFormLink MarkerType { get; set; } + new IFormLink FloraList { get; set; } + new IFormLink LNA2 { get; set; } } public partial interface IBiomeMarkerInternal : @@ -441,12 +1083,49 @@ public partial interface IBiomeMarkerInternal : [AssociatedRecordTypesAttribute(Mutagen.Bethesda.Starfield.Internals.RecordTypeInts.BMMO)] public partial interface IBiomeMarkerGetter : IStarfieldMajorRecordGetter, + IAssetLinkContainerGetter, IBinaryItem, + IFormLinkContainerGetter, + IHaveVirtualMachineAdapterGetter, + IKeywordedGetter, ILoquiObject, IMapsToGetter, - INpcTemplateTargetGetter + IModeledGetter, + INpcTemplateTargetGetter, + IObjectBoundedGetter, + IScriptedGetter { static new ILoquiRegistration StaticRegistration => BiomeMarker_Registration.Instance; + #region VirtualMachineAdapter + /// + /// Aspects: IHaveVirtualMachineAdapterGetter, IScriptedGetter + /// + IVirtualMachineAdapterGetter? VirtualMachineAdapter { get; } + #endregion + #region ObjectBounds + /// + /// Aspects: IObjectBoundedGetter + /// + IObjectBoundsGetter ObjectBounds { get; } + #endregion + Single? ODTY { get; } + IObjectPlacementDefaultsGetter? ObjectPlacementDefaults { get; } + #region Model + /// + /// Aspects: IModeledGetter + /// + IModelGetter? Model { get; } + #endregion + #region Keywords + /// + /// Aspects: IKeywordedGetter<IKeywordGetter> + /// + IReadOnlyList>? Keywords { get; } + #endregion + IReadOnlyList Conditions { get; } + IFormLinkGetter MarkerType { get; } + IFormLinkGetter FloraList { get; } + IFormLinkGetter LNA2 { get; } } @@ -623,6 +1302,16 @@ internal enum BiomeMarker_FieldIndex FormVersion = 4, Version2 = 5, StarfieldMajorRecordFlags = 6, + VirtualMachineAdapter = 7, + ObjectBounds = 8, + ODTY = 9, + ObjectPlacementDefaults = 10, + Model = 11, + Keywords = 12, + Conditions = 13, + MarkerType = 14, + FloraList = 15, + LNA2 = 16, } #endregion @@ -633,9 +1322,9 @@ internal partial class BiomeMarker_Registration : ILoquiRegistration public static ProtocolKey ProtocolKey => ProtocolDefinition_Starfield.ProtocolKey; - public const ushort AdditionalFieldCount = 0; + public const ushort AdditionalFieldCount = 10; - public const ushort FieldCount = 7; + public const ushort FieldCount = 17; public static readonly Type MaskType = typeof(BiomeMarker.Mask<>); @@ -665,8 +1354,33 @@ internal partial class BiomeMarker_Registration : ILoquiRegistration public static RecordTriggerSpecs TriggerSpecs => _recordSpecs.Value; private static readonly Lazy _recordSpecs = new Lazy(() => { - var all = RecordCollection.Factory(RecordTypes.BMMO); - return new RecordTriggerSpecs(allRecordTypes: all); + var triggers = RecordCollection.Factory(RecordTypes.BMMO); + var all = RecordCollection.Factory( + RecordTypes.BMMO, + RecordTypes.VMAD, + RecordTypes.XXXX, + RecordTypes.OBND, + RecordTypes.ODTY, + RecordTypes.OPDS, + RecordTypes.MODL, + RecordTypes.MODT, + RecordTypes.MOLM, + RecordTypes.FLLD, + RecordTypes.XFLG, + RecordTypes.MODC, + RecordTypes.MODF, + RecordTypes.KWDA, + RecordTypes.KSIZ, + RecordTypes.CTDA, + RecordTypes.CITC, + RecordTypes.CIS1, + RecordTypes.CIS2, + RecordTypes.KNAM, + RecordTypes.LNAM, + RecordTypes.LNA2); + return new RecordTriggerSpecs( + allRecordTypes: all, + triggeringRecordTypes: triggers); }); public static readonly Type BinaryWriteTranslation = typeof(BiomeMarkerBinaryWriteTranslation); #region Interface @@ -708,6 +1422,16 @@ internal partial class BiomeMarkerSetterCommon : StarfieldMajorRecordSetterCommo public void Clear(IBiomeMarkerInternal item) { ClearPartial(); + item.VirtualMachineAdapter = null; + item.ObjectBounds.Clear(); + item.ODTY = default; + item.ObjectPlacementDefaults = null; + item.Model = null; + item.Keywords = null; + item.Conditions.Clear(); + item.MarkerType.Clear(); + item.FloraList.Clear(); + item.LNA2.Clear(); base.Clear(item); } @@ -725,6 +1449,39 @@ public override void Clear(IMajorRecordInternal item) public void RemapLinks(IBiomeMarker obj, IReadOnlyDictionary mapping) { base.RemapLinks(obj, mapping); + obj.VirtualMachineAdapter?.RemapLinks(mapping); + obj.Model?.RemapLinks(mapping); + obj.Keywords?.RemapLinks(mapping); + obj.Conditions.RemapLinks(mapping); + obj.MarkerType.Relink(mapping); + obj.FloraList.Relink(mapping); + obj.LNA2.Relink(mapping); + } + + public IEnumerable EnumerateListedAssetLinks(IBiomeMarker obj) + { + foreach (var item in base.EnumerateListedAssetLinks(obj)) + { + yield return item; + } + if (obj.Model is {} ModelItems) + { + foreach (var item in ModelItems.EnumerateListedAssetLinks()) + { + yield return item; + } + } + yield break; + } + + public void RemapAssetLinks( + IBiomeMarker obj, + IReadOnlyDictionary mapping, + IAssetLinkCache? linkCache, + AssetLinkQuery queryCategories) + { + base.RemapAssetLinks(obj, mapping, linkCache, queryCategories); + obj.Model?.RemapAssetLinks(mapping, queryCategories, linkCache); } #endregion @@ -792,6 +1549,34 @@ public void FillEqualsMask( BiomeMarker.Mask ret, EqualsMaskHelper.Include include = EqualsMaskHelper.Include.All) { + ret.VirtualMachineAdapter = EqualsMaskHelper.EqualsHelper( + item.VirtualMachineAdapter, + rhs.VirtualMachineAdapter, + (loqLhs, loqRhs, incl) => loqLhs.GetEqualsMask(loqRhs, incl), + include); + ret.ObjectBounds = MaskItemExt.Factory(item.ObjectBounds.GetEqualsMask(rhs.ObjectBounds, include), include); + ret.ODTY = item.ODTY.EqualsWithin(rhs.ODTY); + ret.ObjectPlacementDefaults = EqualsMaskHelper.EqualsHelper( + item.ObjectPlacementDefaults, + rhs.ObjectPlacementDefaults, + (loqLhs, loqRhs, incl) => loqLhs.GetEqualsMask(loqRhs, incl), + include); + ret.Model = EqualsMaskHelper.EqualsHelper( + item.Model, + rhs.Model, + (loqLhs, loqRhs, incl) => loqLhs.GetEqualsMask(loqRhs, incl), + include); + ret.Keywords = item.Keywords.CollectionEqualsHelper( + rhs.Keywords, + (l, r) => object.Equals(l, r), + include); + ret.Conditions = item.Conditions.CollectionEqualsHelper( + rhs.Conditions, + (loqLhs, loqRhs) => loqLhs.GetEqualsMask(loqRhs, include), + include); + ret.MarkerType = item.MarkerType.Equals(rhs.MarkerType); + ret.FloraList = item.FloraList.Equals(rhs.FloraList); + ret.LNA2 = item.LNA2.Equals(rhs.LNA2); base.FillEqualsMask(item, rhs, ret, include); } @@ -841,6 +1626,71 @@ protected static void ToStringFields( item: item, sb: sb, printMask: printMask); + if ((printMask?.VirtualMachineAdapter?.Overall ?? true) + && item.VirtualMachineAdapter is {} VirtualMachineAdapterItem) + { + VirtualMachineAdapterItem?.Print(sb, "VirtualMachineAdapter"); + } + if (printMask?.ObjectBounds?.Overall ?? true) + { + item.ObjectBounds?.Print(sb, "ObjectBounds"); + } + if ((printMask?.ODTY ?? true) + && item.ODTY is {} ODTYItem) + { + sb.AppendItem(ODTYItem, "ODTY"); + } + if ((printMask?.ObjectPlacementDefaults?.Overall ?? true) + && item.ObjectPlacementDefaults is {} ObjectPlacementDefaultsItem) + { + ObjectPlacementDefaultsItem?.Print(sb, "ObjectPlacementDefaults"); + } + if ((printMask?.Model?.Overall ?? true) + && item.Model is {} ModelItem) + { + ModelItem?.Print(sb, "Model"); + } + if ((printMask?.Keywords?.Overall ?? true) + && item.Keywords is {} KeywordsItem) + { + sb.AppendLine("Keywords =>"); + using (sb.Brace()) + { + foreach (var subItem in KeywordsItem) + { + using (sb.Brace()) + { + sb.AppendItem(subItem.FormKey); + } + } + } + } + if (printMask?.Conditions?.Overall ?? true) + { + sb.AppendLine("Conditions =>"); + using (sb.Brace()) + { + foreach (var subItem in item.Conditions) + { + using (sb.Brace()) + { + subItem?.Print(sb, "Item"); + } + } + } + } + if (printMask?.MarkerType ?? true) + { + sb.AppendItem(item.MarkerType.FormKey, "MarkerType"); + } + if (printMask?.FloraList ?? true) + { + sb.AppendItem(item.FloraList.FormKey, "FloraList"); + } + if (printMask?.LNA2 ?? true) + { + sb.AppendItem(item.LNA2.FormKey, "LNA2"); + } } public static BiomeMarker_FieldIndex ConvertFieldIndex(StarfieldMajorRecord_FieldIndex index) @@ -891,6 +1741,62 @@ public virtual bool Equals( { if (!EqualsMaskHelper.RefEquality(lhs, rhs, out var isEqual)) return isEqual; if (!base.Equals((IStarfieldMajorRecordGetter)lhs, (IStarfieldMajorRecordGetter)rhs, equalsMask)) return false; + if ((equalsMask?.GetShouldTranslate((int)BiomeMarker_FieldIndex.VirtualMachineAdapter) ?? true)) + { + if (EqualsMaskHelper.RefEquality(lhs.VirtualMachineAdapter, rhs.VirtualMachineAdapter, out var lhsVirtualMachineAdapter, out var rhsVirtualMachineAdapter, out var isVirtualMachineAdapterEqual)) + { + if (!((VirtualMachineAdapterCommon)((IVirtualMachineAdapterGetter)lhsVirtualMachineAdapter).CommonInstance()!).Equals(lhsVirtualMachineAdapter, rhsVirtualMachineAdapter, equalsMask?.GetSubCrystal((int)BiomeMarker_FieldIndex.VirtualMachineAdapter))) return false; + } + else if (!isVirtualMachineAdapterEqual) return false; + } + if ((equalsMask?.GetShouldTranslate((int)BiomeMarker_FieldIndex.ObjectBounds) ?? true)) + { + if (EqualsMaskHelper.RefEquality(lhs.ObjectBounds, rhs.ObjectBounds, out var lhsObjectBounds, out var rhsObjectBounds, out var isObjectBoundsEqual)) + { + if (!((ObjectBoundsCommon)((IObjectBoundsGetter)lhsObjectBounds).CommonInstance()!).Equals(lhsObjectBounds, rhsObjectBounds, equalsMask?.GetSubCrystal((int)BiomeMarker_FieldIndex.ObjectBounds))) return false; + } + else if (!isObjectBoundsEqual) return false; + } + if ((equalsMask?.GetShouldTranslate((int)BiomeMarker_FieldIndex.ODTY) ?? true)) + { + if (!lhs.ODTY.EqualsWithin(rhs.ODTY)) return false; + } + if ((equalsMask?.GetShouldTranslate((int)BiomeMarker_FieldIndex.ObjectPlacementDefaults) ?? true)) + { + if (EqualsMaskHelper.RefEquality(lhs.ObjectPlacementDefaults, rhs.ObjectPlacementDefaults, out var lhsObjectPlacementDefaults, out var rhsObjectPlacementDefaults, out var isObjectPlacementDefaultsEqual)) + { + if (!((ObjectPlacementDefaultsCommon)((IObjectPlacementDefaultsGetter)lhsObjectPlacementDefaults).CommonInstance()!).Equals(lhsObjectPlacementDefaults, rhsObjectPlacementDefaults, equalsMask?.GetSubCrystal((int)BiomeMarker_FieldIndex.ObjectPlacementDefaults))) return false; + } + else if (!isObjectPlacementDefaultsEqual) return false; + } + if ((equalsMask?.GetShouldTranslate((int)BiomeMarker_FieldIndex.Model) ?? true)) + { + if (EqualsMaskHelper.RefEquality(lhs.Model, rhs.Model, out var lhsModel, out var rhsModel, out var isModelEqual)) + { + if (!((ModelCommon)((IModelGetter)lhsModel).CommonInstance()!).Equals(lhsModel, rhsModel, equalsMask?.GetSubCrystal((int)BiomeMarker_FieldIndex.Model))) return false; + } + else if (!isModelEqual) return false; + } + if ((equalsMask?.GetShouldTranslate((int)BiomeMarker_FieldIndex.Keywords) ?? true)) + { + if (!lhs.Keywords.SequenceEqualNullable(rhs.Keywords)) return false; + } + if ((equalsMask?.GetShouldTranslate((int)BiomeMarker_FieldIndex.Conditions) ?? true)) + { + if (!lhs.Conditions.SequenceEqual(rhs.Conditions, (l, r) => ((ConditionCommon)((IConditionGetter)l).CommonInstance()!).Equals(l, r, equalsMask?.GetSubCrystal((int)BiomeMarker_FieldIndex.Conditions)))) return false; + } + if ((equalsMask?.GetShouldTranslate((int)BiomeMarker_FieldIndex.MarkerType) ?? true)) + { + if (!lhs.MarkerType.Equals(rhs.MarkerType)) return false; + } + if ((equalsMask?.GetShouldTranslate((int)BiomeMarker_FieldIndex.FloraList) ?? true)) + { + if (!lhs.FloraList.Equals(rhs.FloraList)) return false; + } + if ((equalsMask?.GetShouldTranslate((int)BiomeMarker_FieldIndex.LNA2) ?? true)) + { + if (!lhs.LNA2.Equals(rhs.LNA2)) return false; + } return true; } @@ -919,6 +1825,28 @@ public override bool Equals( public virtual int GetHashCode(IBiomeMarkerGetter item) { var hash = new HashCode(); + if (item.VirtualMachineAdapter is {} VirtualMachineAdapteritem) + { + hash.Add(VirtualMachineAdapteritem); + } + hash.Add(item.ObjectBounds); + if (item.ODTY is {} ODTYitem) + { + hash.Add(ODTYitem); + } + if (item.ObjectPlacementDefaults is {} ObjectPlacementDefaultsitem) + { + hash.Add(ObjectPlacementDefaultsitem); + } + if (item.Model is {} Modelitem) + { + hash.Add(Modelitem); + } + hash.Add(item.Keywords); + hash.Add(item.Conditions); + hash.Add(item.MarkerType); + hash.Add(item.FloraList); + hash.Add(item.LNA2); hash.Add(base.GetHashCode()); return hash.ToHashCode(); } @@ -948,6 +1876,53 @@ public IEnumerable EnumerateFormLinks(IBiomeMarkerGetter obj) { yield return item; } + if (obj.VirtualMachineAdapter is IFormLinkContainerGetter VirtualMachineAdapterlinkCont) + { + foreach (var item in VirtualMachineAdapterlinkCont.EnumerateFormLinks()) + { + yield return item; + } + } + if (obj.Model is {} ModelItems) + { + foreach (var item in ModelItems.EnumerateFormLinks()) + { + yield return item; + } + } + if (obj.Keywords is {} KeywordsItem) + { + foreach (var item in KeywordsItem) + { + yield return FormLinkInformation.Factory(item); + } + } + foreach (var item in obj.Conditions.SelectMany(f => f.EnumerateFormLinks())) + { + yield return FormLinkInformation.Factory(item); + } + yield return FormLinkInformation.Factory(obj.MarkerType); + yield return FormLinkInformation.Factory(obj.FloraList); + yield return FormLinkInformation.Factory(obj.LNA2); + yield break; + } + + public IEnumerable EnumerateAssetLinks(IBiomeMarkerGetter obj, AssetLinkQuery queryCategories, IAssetLinkCache? linkCache, Type? assetType) + { + foreach (var item in base.EnumerateAssetLinks(obj, queryCategories, linkCache, assetType)) + { + yield return item; + } + if (queryCategories.HasFlag(AssetLinkQuery.Listed)) + { + if (obj.Model is {} ModelItems) + { + foreach (var item in ModelItems.EnumerateAssetLinks(queryCategories: queryCategories, linkCache: linkCache, assetType: assetType)) + { + yield return item; + } + } + } yield break; } @@ -1022,6 +1997,173 @@ public void DeepCopyIn( errorMask, copyMask, deepCopy: deepCopy); + if ((copyMask?.GetShouldTranslate((int)BiomeMarker_FieldIndex.VirtualMachineAdapter) ?? true)) + { + errorMask?.PushIndex((int)BiomeMarker_FieldIndex.VirtualMachineAdapter); + try + { + if(rhs.VirtualMachineAdapter is {} rhsVirtualMachineAdapter) + { + item.VirtualMachineAdapter = rhsVirtualMachineAdapter.DeepCopy( + errorMask: errorMask, + copyMask?.GetSubCrystal((int)BiomeMarker_FieldIndex.VirtualMachineAdapter)); + } + else + { + item.VirtualMachineAdapter = default; + } + } + catch (Exception ex) + when (errorMask != null) + { + errorMask.ReportException(ex); + } + finally + { + errorMask?.PopIndex(); + } + } + if ((copyMask?.GetShouldTranslate((int)BiomeMarker_FieldIndex.ObjectBounds) ?? true)) + { + errorMask?.PushIndex((int)BiomeMarker_FieldIndex.ObjectBounds); + try + { + if ((copyMask?.GetShouldTranslate((int)BiomeMarker_FieldIndex.ObjectBounds) ?? true)) + { + item.ObjectBounds = rhs.ObjectBounds.DeepCopy( + copyMask: copyMask?.GetSubCrystal((int)BiomeMarker_FieldIndex.ObjectBounds), + errorMask: errorMask); + } + } + catch (Exception ex) + when (errorMask != null) + { + errorMask.ReportException(ex); + } + finally + { + errorMask?.PopIndex(); + } + } + if ((copyMask?.GetShouldTranslate((int)BiomeMarker_FieldIndex.ODTY) ?? true)) + { + item.ODTY = rhs.ODTY; + } + if ((copyMask?.GetShouldTranslate((int)BiomeMarker_FieldIndex.ObjectPlacementDefaults) ?? true)) + { + errorMask?.PushIndex((int)BiomeMarker_FieldIndex.ObjectPlacementDefaults); + try + { + if(rhs.ObjectPlacementDefaults is {} rhsObjectPlacementDefaults) + { + item.ObjectPlacementDefaults = rhsObjectPlacementDefaults.DeepCopy( + errorMask: errorMask, + copyMask?.GetSubCrystal((int)BiomeMarker_FieldIndex.ObjectPlacementDefaults)); + } + else + { + item.ObjectPlacementDefaults = default; + } + } + catch (Exception ex) + when (errorMask != null) + { + errorMask.ReportException(ex); + } + finally + { + errorMask?.PopIndex(); + } + } + if ((copyMask?.GetShouldTranslate((int)BiomeMarker_FieldIndex.Model) ?? true)) + { + errorMask?.PushIndex((int)BiomeMarker_FieldIndex.Model); + try + { + if(rhs.Model is {} rhsModel) + { + item.Model = rhsModel.DeepCopy( + errorMask: errorMask, + copyMask?.GetSubCrystal((int)BiomeMarker_FieldIndex.Model)); + } + else + { + item.Model = default; + } + } + catch (Exception ex) + when (errorMask != null) + { + errorMask.ReportException(ex); + } + finally + { + errorMask?.PopIndex(); + } + } + if ((copyMask?.GetShouldTranslate((int)BiomeMarker_FieldIndex.Keywords) ?? true)) + { + errorMask?.PushIndex((int)BiomeMarker_FieldIndex.Keywords); + try + { + if ((rhs.Keywords != null)) + { + item.Keywords = + rhs.Keywords + .Select(r => (IFormLinkGetter)new FormLink(r.FormKey)) + .ToExtendedList>(); + } + else + { + item.Keywords = null; + } + } + catch (Exception ex) + when (errorMask != null) + { + errorMask.ReportException(ex); + } + finally + { + errorMask?.PopIndex(); + } + } + if ((copyMask?.GetShouldTranslate((int)BiomeMarker_FieldIndex.Conditions) ?? true)) + { + errorMask?.PushIndex((int)BiomeMarker_FieldIndex.Conditions); + try + { + item.Conditions.SetTo( + rhs.Conditions + .Select(r => + { + return r.DeepCopy( + errorMask: errorMask, + default(TranslationCrystal)); + })); + } + catch (Exception ex) + when (errorMask != null) + { + errorMask.ReportException(ex); + } + finally + { + errorMask?.PopIndex(); + } + } + if ((copyMask?.GetShouldTranslate((int)BiomeMarker_FieldIndex.MarkerType) ?? true)) + { + item.MarkerType.SetTo(rhs.MarkerType.FormKey); + } + if ((copyMask?.GetShouldTranslate((int)BiomeMarker_FieldIndex.FloraList) ?? true)) + { + item.FloraList.SetTo(rhs.FloraList.FormKey); + } + if ((copyMask?.GetShouldTranslate((int)BiomeMarker_FieldIndex.LNA2) ?? true)) + { + item.LNA2.SetTo(rhs.LNA2.FormKey); + } } public override void DeepCopyIn( @@ -1170,6 +2312,82 @@ public partial class BiomeMarkerBinaryWriteTranslation : { public new static readonly BiomeMarkerBinaryWriteTranslation Instance = new(); + public static void WriteRecordTypes( + IBiomeMarkerGetter item, + MutagenWriter writer, + TypedWriteParams translationParams) + { + MajorRecordBinaryWriteTranslation.WriteRecordTypes( + item: item, + writer: writer, + translationParams: translationParams); + if (item.VirtualMachineAdapter is {} VirtualMachineAdapterItem) + { + ((VirtualMachineAdapterBinaryWriteTranslation)((IBinaryItem)VirtualMachineAdapterItem).BinaryWriteTranslator).Write( + item: VirtualMachineAdapterItem, + writer: writer, + translationParams: translationParams.With(RecordTypes.XXXX)); + } + var ObjectBoundsItem = item.ObjectBounds; + ((ObjectBoundsBinaryWriteTranslation)((IBinaryItem)ObjectBoundsItem).BinaryWriteTranslator).Write( + item: ObjectBoundsItem, + writer: writer, + translationParams: translationParams); + FloatBinaryTranslation.Instance.WriteNullable( + writer: writer, + item: item.ODTY, + header: translationParams.ConvertToCustom(RecordTypes.ODTY)); + if (item.ObjectPlacementDefaults is {} ObjectPlacementDefaultsItem) + { + ((ObjectPlacementDefaultsBinaryWriteTranslation)((IBinaryItem)ObjectPlacementDefaultsItem).BinaryWriteTranslator).Write( + item: ObjectPlacementDefaultsItem, + writer: writer, + translationParams: translationParams); + } + if (item.Model is {} ModelItem) + { + ((ModelBinaryWriteTranslation)((IBinaryItem)ModelItem).BinaryWriteTranslator).Write( + item: ModelItem, + writer: writer, + translationParams: translationParams); + } + Mutagen.Bethesda.Plugins.Binary.Translations.ListBinaryTranslation>.Instance.WriteWithCounter( + writer: writer, + items: item.Keywords, + counterType: RecordTypes.KSIZ, + counterLength: 4, + recordType: translationParams.ConvertToCustom(RecordTypes.KWDA), + transl: (MutagenWriter subWriter, IFormLinkGetter subItem, TypedWriteParams conv) => + { + FormLinkBinaryTranslation.Instance.Write( + writer: subWriter, + item: subItem); + }); + Mutagen.Bethesda.Plugins.Binary.Translations.ListBinaryTranslation.Instance.Write( + writer: writer, + items: item.Conditions, + transl: (MutagenWriter subWriter, IConditionGetter subItem, TypedWriteParams conv) => + { + var Item = subItem; + ((ConditionBinaryWriteTranslation)((IBinaryItem)Item).BinaryWriteTranslator).Write( + item: Item, + writer: subWriter, + translationParams: conv); + }); + FormLinkBinaryTranslation.Instance.Write( + writer: writer, + item: item.MarkerType, + header: translationParams.ConvertToCustom(RecordTypes.KNAM)); + FormLinkBinaryTranslation.Instance.Write( + writer: writer, + item: item.FloraList, + header: translationParams.ConvertToCustom(RecordTypes.LNAM)); + FormLinkBinaryTranslation.Instance.Write( + writer: writer, + item: item.LNA2, + header: translationParams.ConvertToCustom(RecordTypes.LNA2)); + } + public void Write( MutagenWriter writer, IBiomeMarkerGetter item, @@ -1186,10 +2404,12 @@ public void Write( writer: writer); if (!item.IsDeleted) { - MajorRecordBinaryWriteTranslation.WriteRecordTypes( + writer.MetaData.FormVersion = item.FormVersion; + WriteRecordTypes( item: item, writer: writer, translationParams: translationParams); + writer.MetaData.FormVersion = null; } } catch (Exception ex) @@ -1239,6 +2459,112 @@ internal partial class BiomeMarkerBinaryCreateTranslation : StarfieldMajorRecord public new static readonly BiomeMarkerBinaryCreateTranslation Instance = new BiomeMarkerBinaryCreateTranslation(); public override RecordType RecordType => RecordTypes.BMMO; + public static ParseResult FillBinaryRecordTypes( + IBiomeMarkerInternal item, + MutagenFrame frame, + PreviousParse lastParsed, + Dictionary? recordParseCount, + RecordType nextRecordType, + int contentLength, + TypedParseParams translationParams = default) + { + nextRecordType = translationParams.ConvertToStandard(nextRecordType); + switch (nextRecordType.TypeInt) + { + case RecordTypeInts.VMAD: + { + item.VirtualMachineAdapter = Mutagen.Bethesda.Starfield.VirtualMachineAdapter.CreateFromBinary( + frame: frame, + translationParams: translationParams.With(lastParsed.LengthOverride).DoNotShortCircuit()); + return (int)BiomeMarker_FieldIndex.VirtualMachineAdapter; + } + case RecordTypeInts.OBND: + { + item.ObjectBounds = Mutagen.Bethesda.Starfield.ObjectBounds.CreateFromBinary(frame: frame); + return (int)BiomeMarker_FieldIndex.ObjectBounds; + } + case RecordTypeInts.ODTY: + { + frame.Position += frame.MetaData.Constants.SubConstants.HeaderLength; + item.ODTY = FloatBinaryTranslation.Instance.Parse(reader: frame.SpawnWithLength(contentLength)); + return (int)BiomeMarker_FieldIndex.ODTY; + } + case RecordTypeInts.OPDS: + { + item.ObjectPlacementDefaults = Mutagen.Bethesda.Starfield.ObjectPlacementDefaults.CreateFromBinary(frame: frame); + return (int)BiomeMarker_FieldIndex.ObjectPlacementDefaults; + } + case RecordTypeInts.MODL: + case RecordTypeInts.MODT: + case RecordTypeInts.MOLM: + case RecordTypeInts.FLLD: + case RecordTypeInts.XFLG: + case RecordTypeInts.MODC: + case RecordTypeInts.MODF: + { + item.Model = Mutagen.Bethesda.Starfield.Model.CreateFromBinary( + frame: frame, + translationParams: translationParams.DoNotShortCircuit()); + return (int)BiomeMarker_FieldIndex.Model; + } + case RecordTypeInts.KSIZ: + case RecordTypeInts.KWDA: + { + item.Keywords = + Mutagen.Bethesda.Plugins.Binary.Translations.ListBinaryTranslation>.Instance.Parse( + reader: frame, + countLengthLength: 4, + countRecord: translationParams.ConvertToCustom(RecordTypes.KSIZ), + triggeringRecord: translationParams.ConvertToCustom(RecordTypes.KWDA), + transl: FormLinkBinaryTranslation.Instance.Parse) + .CastExtendedList>(); + return (int)BiomeMarker_FieldIndex.Keywords; + } + case RecordTypeInts.CTDA: + { + item.Conditions.SetTo( + Mutagen.Bethesda.Plugins.Binary.Translations.ListBinaryTranslation.Instance.Parse( + reader: frame, + triggeringRecord: Condition_Registration.TriggerSpecs, + translationParams: translationParams, + transl: Condition.TryCreateFromBinary)); + return (int)BiomeMarker_FieldIndex.Conditions; + } + case RecordTypeInts.KNAM: + { + frame.Position += frame.MetaData.Constants.SubConstants.HeaderLength; + item.MarkerType.SetTo(FormLinkBinaryTranslation.Instance.Parse(reader: frame)); + return (int)BiomeMarker_FieldIndex.MarkerType; + } + case RecordTypeInts.LNAM: + { + frame.Position += frame.MetaData.Constants.SubConstants.HeaderLength; + item.FloraList.SetTo(FormLinkBinaryTranslation.Instance.Parse(reader: frame)); + return (int)BiomeMarker_FieldIndex.FloraList; + } + case RecordTypeInts.LNA2: + { + frame.Position += frame.MetaData.Constants.SubConstants.HeaderLength; + item.LNA2.SetTo(FormLinkBinaryTranslation.Instance.Parse(reader: frame)); + return (int)BiomeMarker_FieldIndex.LNA2; + } + case RecordTypeInts.XXXX: + { + var overflowHeader = frame.ReadSubrecord(); + return ParseResult.OverrideLength(BinaryPrimitives.ReadUInt32LittleEndian(overflowHeader.Content)); + } + default: + return StarfieldMajorRecordBinaryCreateTranslation.FillBinaryRecordTypes( + item: item, + frame: frame, + lastParsed: lastParsed, + recordParseCount: recordParseCount, + nextRecordType: nextRecordType, + contentLength: contentLength, + translationParams: translationParams.WithNoConverter()); + } + } + } } @@ -1271,6 +2597,8 @@ internal partial class BiomeMarkerBinaryOverlay : void IPrintable.Print(StructuredStringBuilder sb, string? name) => this.Print(sb, name); + public override IEnumerable EnumerateFormLinks() => BiomeMarkerCommon.Instance.EnumerateFormLinks(this); + public override IEnumerable EnumerateAssetLinks(AssetLinkQuery queryCategories, IAssetLinkCache? linkCache, Type? assetType) => BiomeMarkerCommon.Instance.EnumerateAssetLinks(this, queryCategories, linkCache, assetType); [DebuggerBrowsable(DebuggerBrowsableState.Never)] protected override object BinaryWriteTranslator => BiomeMarkerBinaryWriteTranslation.Instance; void IBinaryItem.WriteToBinary( @@ -1285,6 +2613,43 @@ void IBinaryItem.WriteToBinary( protected override Type LinkType => typeof(IBiomeMarker); + #region VirtualMachineAdapter + private int? _VirtualMachineAdapterLengthOverride; + private RangeInt32? _VirtualMachineAdapterLocation; + public IVirtualMachineAdapterGetter? VirtualMachineAdapter => _VirtualMachineAdapterLocation.HasValue ? VirtualMachineAdapterBinaryOverlay.VirtualMachineAdapterFactory(_recordData.Slice(_VirtualMachineAdapterLocation!.Value.Min), _package, TypedParseParams.FromLengthOverride(_VirtualMachineAdapterLengthOverride)) : default; + IAVirtualMachineAdapterGetter? IHaveVirtualMachineAdapterGetter.VirtualMachineAdapter => this.VirtualMachineAdapter; + #endregion + #region ObjectBounds + private RangeInt32? _ObjectBoundsLocation; + private IObjectBoundsGetter? _ObjectBounds => _ObjectBoundsLocation.HasValue ? ObjectBoundsBinaryOverlay.ObjectBoundsFactory(_recordData.Slice(_ObjectBoundsLocation!.Value.Min), _package) : default; + public IObjectBoundsGetter ObjectBounds => _ObjectBounds ?? new ObjectBounds(); + #endregion + #region ODTY + private int? _ODTYLocation; + public Single? ODTY => _ODTYLocation.HasValue ? HeaderTranslation.ExtractSubrecordMemory(_recordData, _ODTYLocation.Value, _package.MetaData.Constants).Float() : default(Single?); + #endregion + #region ObjectPlacementDefaults + private RangeInt32? _ObjectPlacementDefaultsLocation; + public IObjectPlacementDefaultsGetter? ObjectPlacementDefaults => _ObjectPlacementDefaultsLocation.HasValue ? ObjectPlacementDefaultsBinaryOverlay.ObjectPlacementDefaultsFactory(_recordData.Slice(_ObjectPlacementDefaultsLocation!.Value.Min), _package) : default; + #endregion + public IModelGetter? Model { get; private set; } + #region Keywords + public IReadOnlyList>? Keywords { get; private set; } + IReadOnlyList>? IKeywordedGetter.Keywords => this.Keywords; + #endregion + public IReadOnlyList Conditions { get; private set; } = Array.Empty(); + #region MarkerType + private int? _MarkerTypeLocation; + public IFormLinkGetter MarkerType => _MarkerTypeLocation.HasValue ? new FormLink(FormKey.Factory(_package.MetaData.MasterReferences!, BinaryPrimitives.ReadUInt32LittleEndian(HeaderTranslation.ExtractSubrecordMemory(_recordData, _MarkerTypeLocation.Value, _package.MetaData.Constants)))) : FormLink.Null; + #endregion + #region FloraList + private int? _FloraListLocation; + public IFormLinkGetter FloraList => _FloraListLocation.HasValue ? new FormLink(FormKey.Factory(_package.MetaData.MasterReferences!, BinaryPrimitives.ReadUInt32LittleEndian(HeaderTranslation.ExtractSubrecordMemory(_recordData, _FloraListLocation.Value, _package.MetaData.Constants)))) : FormLink.Null; + #endregion + #region LNA2 + private int? _LNA2Location; + public IFormLinkGetter LNA2 => _LNA2Location.HasValue ? new FormLink(FormKey.Factory(_package.MetaData.MasterReferences!, BinaryPrimitives.ReadUInt32LittleEndian(HeaderTranslation.ExtractSubrecordMemory(_recordData, _LNA2Location.Value, _package.MetaData.Constants)))) : FormLink.Null; + #endregion partial void CustomFactoryEnd( OverlayStream stream, int finalPos, @@ -1342,6 +2707,116 @@ public static IBiomeMarkerGetter BiomeMarkerFactory( translationParams: translationParams); } + public override ParseResult FillRecordType( + OverlayStream stream, + int finalPos, + int offset, + RecordType type, + PreviousParse lastParsed, + Dictionary? recordParseCount, + TypedParseParams translationParams = default) + { + type = translationParams.ConvertToStandard(type); + switch (type.TypeInt) + { + case RecordTypeInts.VMAD: + { + _VirtualMachineAdapterLocation = new RangeInt32((stream.Position - offset), finalPos - offset); + _VirtualMachineAdapterLengthOverride = lastParsed.LengthOverride; + if (lastParsed.LengthOverride.HasValue) + { + stream.Position += lastParsed.LengthOverride.Value; + } + return (int)BiomeMarker_FieldIndex.VirtualMachineAdapter; + } + case RecordTypeInts.OBND: + { + _ObjectBoundsLocation = new RangeInt32((stream.Position - offset), finalPos - offset); + return (int)BiomeMarker_FieldIndex.ObjectBounds; + } + case RecordTypeInts.ODTY: + { + _ODTYLocation = (stream.Position - offset); + return (int)BiomeMarker_FieldIndex.ODTY; + } + case RecordTypeInts.OPDS: + { + _ObjectPlacementDefaultsLocation = new RangeInt32((stream.Position - offset), finalPos - offset); + return (int)BiomeMarker_FieldIndex.ObjectPlacementDefaults; + } + case RecordTypeInts.MODL: + case RecordTypeInts.MODT: + case RecordTypeInts.MOLM: + case RecordTypeInts.FLLD: + case RecordTypeInts.XFLG: + case RecordTypeInts.MODC: + case RecordTypeInts.MODF: + { + this.Model = ModelBinaryOverlay.ModelFactory( + stream: stream, + package: _package, + translationParams: translationParams.DoNotShortCircuit()); + return (int)BiomeMarker_FieldIndex.Model; + } + case RecordTypeInts.KSIZ: + case RecordTypeInts.KWDA: + { + this.Keywords = BinaryOverlayList.FactoryByCount>( + stream: stream, + package: _package, + itemLength: 0x4, + countLength: 4, + countType: RecordTypes.KSIZ, + trigger: RecordTypes.KWDA, + getter: (s, p) => new FormLink(FormKey.Factory(p.MetaData.MasterReferences!, BinaryPrimitives.ReadUInt32LittleEndian(s)))); + return (int)BiomeMarker_FieldIndex.Keywords; + } + case RecordTypeInts.CTDA: + { + this.Conditions = BinaryOverlayList.FactoryByArray( + mem: stream.RemainingMemory, + package: _package, + translationParams: translationParams, + getter: (s, p, recConv) => ConditionBinaryOverlay.ConditionFactory(new OverlayStream(s, p), p, recConv), + locs: ParseRecordLocations( + stream: stream, + trigger: Condition_Registration.TriggerSpecs, + triggersAlwaysAreNewRecords: true, + constants: _package.MetaData.Constants.SubConstants, + skipHeader: false)); + return (int)BiomeMarker_FieldIndex.Conditions; + } + case RecordTypeInts.KNAM: + { + _MarkerTypeLocation = (stream.Position - offset); + return (int)BiomeMarker_FieldIndex.MarkerType; + } + case RecordTypeInts.LNAM: + { + _FloraListLocation = (stream.Position - offset); + return (int)BiomeMarker_FieldIndex.FloraList; + } + case RecordTypeInts.LNA2: + { + _LNA2Location = (stream.Position - offset); + return (int)BiomeMarker_FieldIndex.LNA2; + } + case RecordTypeInts.XXXX: + { + var overflowHeader = stream.ReadSubrecord(); + return ParseResult.OverrideLength(BinaryPrimitives.ReadUInt32LittleEndian(overflowHeader.Content)); + } + default: + return base.FillRecordType( + stream: stream, + finalPos: finalPos, + offset: offset, + type: type, + lastParsed: lastParsed, + recordParseCount: recordParseCount, + translationParams: translationParams.WithNoConverter()); + } + } #region To String public override void Print( diff --git a/Mutagen.Bethesda.Starfield/Records/RecordTypeInts_Generated.cs b/Mutagen.Bethesda.Starfield/Records/RecordTypeInts_Generated.cs index bde8d285e..769999103 100644 --- a/Mutagen.Bethesda.Starfield/Records/RecordTypeInts_Generated.cs +++ b/Mutagen.Bethesda.Starfield/Records/RecordTypeInts_Generated.cs @@ -428,6 +428,7 @@ public partial class RecordTypeInts public const int LLKC = 0x434B4C4C; public const int LLLD = 0x444C4C4C; public const int LMSW = 0x57534D4C; + public const int LNA2 = 0x32414E4C; public const int LNAM = 0x4D414E4C; public const int LODB = 0x42444F4C; public const int LRNM = 0x4D4E524C; diff --git a/Mutagen.Bethesda.Starfield/Records/RecordTypes_Generated.cs b/Mutagen.Bethesda.Starfield/Records/RecordTypes_Generated.cs index fd2b92e11..99e509efe 100644 --- a/Mutagen.Bethesda.Starfield/Records/RecordTypes_Generated.cs +++ b/Mutagen.Bethesda.Starfield/Records/RecordTypes_Generated.cs @@ -430,6 +430,7 @@ public partial class RecordTypes public static readonly RecordType LLKC = new(0x434B4C4C); public static readonly RecordType LLLD = new(0x444C4C4C); public static readonly RecordType LMSW = new(0x57534D4C); + public static readonly RecordType LNA2 = new(0x32414E4C); public static readonly RecordType LNAM = new(0x4D414E4C); public static readonly RecordType LODB = new(0x42444F4C); public static readonly RecordType LRNM = new(0x4D4E524C); diff --git a/Mutagen.Bethesda.Starfield/Records/StarfieldMod.xml b/Mutagen.Bethesda.Starfield/Records/StarfieldMod.xml index 8f22541d5..a212b7851 100644 --- a/Mutagen.Bethesda.Starfield/Records/StarfieldMod.xml +++ b/Mutagen.Bethesda.Starfield/Records/StarfieldMod.xml @@ -52,6 +52,7 @@ + diff --git a/Mutagen.Bethesda.Starfield/Records/StarfieldMod_Generated.cs b/Mutagen.Bethesda.Starfield/Records/StarfieldMod_Generated.cs index cd5bb52f1..071e6f32d 100644 --- a/Mutagen.Bethesda.Starfield/Records/StarfieldMod_Generated.cs +++ b/Mutagen.Bethesda.Starfield/Records/StarfieldMod_Generated.cs @@ -110,6 +110,7 @@ protected StarfieldMod() _Keys_Object = new StarfieldGroup(this); _Ingestibles_Object = new StarfieldGroup(this); _IdleMarkers_Object = new StarfieldGroup(this); + _BiomeMarkers_Object = new StarfieldGroup(this); _GenericBaseForms_Object = new StarfieldGroup(this); _LeveledBaseForms_Object = new StarfieldGroup(this); _Weathers_Object = new StarfieldGroup(this); @@ -498,6 +499,13 @@ protected StarfieldMod() [DebuggerBrowsable(DebuggerBrowsableState.Never)] IStarfieldGroupGetter IStarfieldModGetter.IdleMarkers => _IdleMarkers_Object; #endregion + #region BiomeMarkers + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private StarfieldGroup _BiomeMarkers_Object; + public StarfieldGroup BiomeMarkers => _BiomeMarkers_Object; + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + IStarfieldGroupGetter IStarfieldModGetter.BiomeMarkers => _BiomeMarkers_Object; + #endregion #region GenericBaseForms [DebuggerBrowsable(DebuggerBrowsableState.Never)] private StarfieldGroup _GenericBaseForms_Object; @@ -825,6 +833,7 @@ public Mask(TItem initialValue) this.Keys = new MaskItem?>(initialValue, new StarfieldGroup.Mask(initialValue)); this.Ingestibles = new MaskItem?>(initialValue, new StarfieldGroup.Mask(initialValue)); this.IdleMarkers = new MaskItem?>(initialValue, new StarfieldGroup.Mask(initialValue)); + this.BiomeMarkers = new MaskItem?>(initialValue, new StarfieldGroup.Mask(initialValue)); this.GenericBaseForms = new MaskItem?>(initialValue, new StarfieldGroup.Mask(initialValue)); this.LeveledBaseForms = new MaskItem?>(initialValue, new StarfieldGroup.Mask(initialValue)); this.Weathers = new MaskItem?>(initialValue, new StarfieldGroup.Mask(initialValue)); @@ -912,6 +921,7 @@ public Mask( TItem Keys, TItem Ingestibles, TItem IdleMarkers, + TItem BiomeMarkers, TItem GenericBaseForms, TItem LeveledBaseForms, TItem Weathers, @@ -997,6 +1007,7 @@ public Mask( this.Keys = new MaskItem?>(Keys, new StarfieldGroup.Mask(Keys)); this.Ingestibles = new MaskItem?>(Ingestibles, new StarfieldGroup.Mask(Ingestibles)); this.IdleMarkers = new MaskItem?>(IdleMarkers, new StarfieldGroup.Mask(IdleMarkers)); + this.BiomeMarkers = new MaskItem?>(BiomeMarkers, new StarfieldGroup.Mask(BiomeMarkers)); this.GenericBaseForms = new MaskItem?>(GenericBaseForms, new StarfieldGroup.Mask(GenericBaseForms)); this.LeveledBaseForms = new MaskItem?>(LeveledBaseForms, new StarfieldGroup.Mask(LeveledBaseForms)); this.Weathers = new MaskItem?>(Weathers, new StarfieldGroup.Mask(Weathers)); @@ -1092,6 +1103,7 @@ protected Mask() public MaskItem?>? Keys { get; set; } public MaskItem?>? Ingestibles { get; set; } public MaskItem?>? IdleMarkers { get; set; } + public MaskItem?>? BiomeMarkers { get; set; } public MaskItem?>? GenericBaseForms { get; set; } public MaskItem?>? LeveledBaseForms { get; set; } public MaskItem?>? Weathers { get; set; } @@ -1188,6 +1200,7 @@ public bool Equals(Mask? rhs) if (!object.Equals(this.Keys, rhs.Keys)) return false; if (!object.Equals(this.Ingestibles, rhs.Ingestibles)) return false; if (!object.Equals(this.IdleMarkers, rhs.IdleMarkers)) return false; + if (!object.Equals(this.BiomeMarkers, rhs.BiomeMarkers)) return false; if (!object.Equals(this.GenericBaseForms, rhs.GenericBaseForms)) return false; if (!object.Equals(this.LeveledBaseForms, rhs.LeveledBaseForms)) return false; if (!object.Equals(this.Weathers, rhs.Weathers)) return false; @@ -1277,6 +1290,7 @@ public override int GetHashCode() hash.Add(this.Keys); hash.Add(this.Ingestibles); hash.Add(this.IdleMarkers); + hash.Add(this.BiomeMarkers); hash.Add(this.GenericBaseForms); hash.Add(this.LeveledBaseForms); hash.Add(this.Weathers); @@ -1569,6 +1583,11 @@ public bool All(Func eval) if (!eval(this.IdleMarkers.Overall)) return false; if (this.IdleMarkers.Specific != null && !this.IdleMarkers.Specific.All(eval)) return false; } + if (BiomeMarkers != null) + { + if (!eval(this.BiomeMarkers.Overall)) return false; + if (this.BiomeMarkers.Specific != null && !this.BiomeMarkers.Specific.All(eval)) return false; + } if (GenericBaseForms != null) { if (!eval(this.GenericBaseForms.Overall)) return false; @@ -1996,6 +2015,11 @@ public bool Any(Func eval) if (eval(this.IdleMarkers.Overall)) return true; if (this.IdleMarkers.Specific != null && this.IdleMarkers.Specific.Any(eval)) return true; } + if (BiomeMarkers != null) + { + if (eval(this.BiomeMarkers.Overall)) return true; + if (this.BiomeMarkers.Specific != null && this.BiomeMarkers.Specific.Any(eval)) return true; + } if (GenericBaseForms != null) { if (eval(this.GenericBaseForms.Overall)) return true; @@ -2230,6 +2254,7 @@ protected void Translate_InternalFill(Mask obj, Func eval) obj.Keys = this.Keys == null ? null : new MaskItem?>(eval(this.Keys.Overall), this.Keys.Specific?.Translate(eval)); obj.Ingestibles = this.Ingestibles == null ? null : new MaskItem?>(eval(this.Ingestibles.Overall), this.Ingestibles.Specific?.Translate(eval)); obj.IdleMarkers = this.IdleMarkers == null ? null : new MaskItem?>(eval(this.IdleMarkers.Overall), this.IdleMarkers.Specific?.Translate(eval)); + obj.BiomeMarkers = this.BiomeMarkers == null ? null : new MaskItem?>(eval(this.BiomeMarkers.Overall), this.BiomeMarkers.Specific?.Translate(eval)); obj.GenericBaseForms = this.GenericBaseForms == null ? null : new MaskItem?>(eval(this.GenericBaseForms.Overall), this.GenericBaseForms.Specific?.Translate(eval)); obj.LeveledBaseForms = this.LeveledBaseForms == null ? null : new MaskItem?>(eval(this.LeveledBaseForms.Overall), this.LeveledBaseForms.Specific?.Translate(eval)); obj.Weathers = this.Weathers == null ? null : new MaskItem?>(eval(this.Weathers.Overall), this.Weathers.Specific?.Translate(eval)); @@ -2482,6 +2507,10 @@ public void Print(StructuredStringBuilder sb, StarfieldMod.Mask? printMask { IdleMarkers?.Print(sb); } + if (printMask?.BiomeMarkers?.Overall ?? true) + { + BiomeMarkers?.Print(sb); + } if (printMask?.GenericBaseForms?.Overall ?? true) { GenericBaseForms?.Print(sb); @@ -2692,6 +2721,7 @@ public List Warnings public MaskItem?>? Keys; public MaskItem?>? Ingestibles; public MaskItem?>? IdleMarkers; + public MaskItem?>? BiomeMarkers; public MaskItem?>? GenericBaseForms; public MaskItem?>? LeveledBaseForms; public MaskItem?>? Weathers; @@ -2834,6 +2864,8 @@ public List Warnings return Ingestibles; case StarfieldMod_FieldIndex.IdleMarkers: return IdleMarkers; + case StarfieldMod_FieldIndex.BiomeMarkers: + return BiomeMarkers; case StarfieldMod_FieldIndex.GenericBaseForms: return GenericBaseForms; case StarfieldMod_FieldIndex.LeveledBaseForms: @@ -3062,6 +3094,9 @@ public void SetNthException(int index, Exception ex) case StarfieldMod_FieldIndex.IdleMarkers: this.IdleMarkers = new MaskItem?>(ex, null); break; + case StarfieldMod_FieldIndex.BiomeMarkers: + this.BiomeMarkers = new MaskItem?>(ex, null); + break; case StarfieldMod_FieldIndex.GenericBaseForms: this.GenericBaseForms = new MaskItem?>(ex, null); break; @@ -3324,6 +3359,9 @@ public void SetNthMask(int index, object obj) case StarfieldMod_FieldIndex.IdleMarkers: this.IdleMarkers = (MaskItem?>?)obj; break; + case StarfieldMod_FieldIndex.BiomeMarkers: + this.BiomeMarkers = (MaskItem?>?)obj; + break; case StarfieldMod_FieldIndex.GenericBaseForms: this.GenericBaseForms = (MaskItem?>?)obj; break; @@ -3484,6 +3522,7 @@ public bool IsInError() if (Keys != null) return true; if (Ingestibles != null) return true; if (IdleMarkers != null) return true; + if (BiomeMarkers != null) return true; if (GenericBaseForms != null) return true; if (LeveledBaseForms != null) return true; if (Weathers != null) return true; @@ -3593,6 +3632,7 @@ protected void PrintFillInternal(StructuredStringBuilder sb) Keys?.Print(sb); Ingestibles?.Print(sb); IdleMarkers?.Print(sb); + BiomeMarkers?.Print(sb); GenericBaseForms?.Print(sb); LeveledBaseForms?.Print(sb); Weathers?.Print(sb); @@ -3685,6 +3725,7 @@ public ErrorMask Combine(ErrorMask? rhs) ret.Keys = this.Keys.Combine(rhs.Keys, (l, r) => l.Combine(r)); ret.Ingestibles = this.Ingestibles.Combine(rhs.Ingestibles, (l, r) => l.Combine(r)); ret.IdleMarkers = this.IdleMarkers.Combine(rhs.IdleMarkers, (l, r) => l.Combine(r)); + ret.BiomeMarkers = this.BiomeMarkers.Combine(rhs.BiomeMarkers, (l, r) => l.Combine(r)); ret.GenericBaseForms = this.GenericBaseForms.Combine(rhs.GenericBaseForms, (l, r) => l.Combine(r)); ret.LeveledBaseForms = this.LeveledBaseForms.Combine(rhs.LeveledBaseForms, (l, r) => l.Combine(r)); ret.Weathers = this.Weathers.Combine(rhs.Weathers, (l, r) => l.Combine(r)); @@ -3792,6 +3833,7 @@ public class TranslationMask : ITranslationMask public StarfieldGroup.TranslationMask? Keys; public StarfieldGroup.TranslationMask? Ingestibles; public StarfieldGroup.TranslationMask? IdleMarkers; + public StarfieldGroup.TranslationMask? BiomeMarkers; public StarfieldGroup.TranslationMask? GenericBaseForms; public StarfieldGroup.TranslationMask? LeveledBaseForms; public StarfieldGroup.TranslationMask? Weathers; @@ -3900,6 +3942,7 @@ protected void GetCrystal(List<(bool On, TranslationCrystal? SubCrystal)> ret) ret.Add((Keys != null ? Keys.OnOverall : DefaultOn, Keys?.GetCrystal())); ret.Add((Ingestibles != null ? Ingestibles.OnOverall : DefaultOn, Ingestibles?.GetCrystal())); ret.Add((IdleMarkers != null ? IdleMarkers.OnOverall : DefaultOn, IdleMarkers?.GetCrystal())); + ret.Add((BiomeMarkers != null ? BiomeMarkers.OnOverall : DefaultOn, BiomeMarkers?.GetCrystal())); ret.Add((GenericBaseForms != null ? GenericBaseForms.OnOverall : DefaultOn, GenericBaseForms?.GetCrystal())); ret.Add((LeveledBaseForms != null ? LeveledBaseForms.OnOverall : DefaultOn, LeveledBaseForms?.GetCrystal())); ret.Add((Weathers != null ? Weathers.OnOverall : DefaultOn, Weathers?.GetCrystal())); @@ -4030,6 +4073,7 @@ public StarfieldMod( _Keys_Object = new StarfieldGroup(this); _Ingestibles_Object = new StarfieldGroup(this); _IdleMarkers_Object = new StarfieldGroup(this); + _BiomeMarkers_Object = new StarfieldGroup(this); _GenericBaseForms_Object = new StarfieldGroup(this); _LeveledBaseForms_Object = new StarfieldGroup(this); _Weathers_Object = new StarfieldGroup(this); @@ -4265,6 +4309,10 @@ public void AddRecords( { this.IdleMarkers.RecordCache.Set(rhsMod.IdleMarkers.RecordCache.Items); } + if (mask?.BiomeMarkers ?? true) + { + this.BiomeMarkers.RecordCache.Set(rhsMod.BiomeMarkers.RecordCache.Items); + } if (mask?.GenericBaseForms ?? true) { this.GenericBaseForms.RecordCache.Set(rhsMod.GenericBaseForms.RecordCache.Items); @@ -4463,6 +4511,7 @@ public uint GetRecordCount() count += Keys.RecordCache.Count > 0 ? 1 : default(uint); count += Ingestibles.RecordCache.Count > 0 ? 1 : default(uint); count += IdleMarkers.RecordCache.Count > 0 ? 1 : default(uint); + count += BiomeMarkers.RecordCache.Count > 0 ? 1 : default(uint); count += GenericBaseForms.RecordCache.Count > 0 ? 1 : default(uint); count += LeveledBaseForms.RecordCache.Count > 0 ? 1 : default(uint); count += Weathers.RecordCache.Count > 0 ? 1 : default(uint); @@ -4820,6 +4869,7 @@ public partial interface IStarfieldMod : new StarfieldGroup Keys { get; } new StarfieldGroup Ingestibles { get; } new StarfieldGroup IdleMarkers { get; } + new StarfieldGroup BiomeMarkers { get; } new StarfieldGroup GenericBaseForms { get; } new StarfieldGroup LeveledBaseForms { get; } new StarfieldGroup Weathers { get; } @@ -4923,6 +4973,7 @@ public partial interface IStarfieldModGetter : IStarfieldGroupGetter Keys { get; } IStarfieldGroupGetter Ingestibles { get; } IStarfieldGroupGetter IdleMarkers { get; } + IStarfieldGroupGetter BiomeMarkers { get; } IStarfieldGroupGetter GenericBaseForms { get; } IStarfieldGroupGetter LeveledBaseForms { get; } IStarfieldGroupGetter Weathers { get; } @@ -5589,40 +5640,41 @@ internal enum StarfieldMod_FieldIndex Keys = 47, Ingestibles = 48, IdleMarkers = 49, - GenericBaseForms = 50, - LeveledBaseForms = 51, - Weathers = 52, - Cells = 53, - Worldspaces = 54, - Quests = 55, - Packages = 56, - CombatStyles = 57, - LoadScreens = 58, - AnimatedObjects = 59, - Waters = 60, - Debris = 61, - FormLists = 62, - Perks = 63, - ArmorAddons = 64, - Locations = 65, - DefaultObjects = 66, - Outfits = 67, - AimModels = 68, - AimAssistModels = 69, - Layers = 70, - ConstructibleObjects = 71, - ObjectModifications = 72, - InstanceNamingRules = 73, - AttractionRules = 74, - Resources = 75, - BiomeSwaps = 76, - SnapTemplates = 77, - Planets = 78, - ConditionRecords = 79, - SurfacePatternStyles = 80, - TerminalMenus = 81, - LegendaryItems = 82, - ActorValueModulations = 83, + BiomeMarkers = 50, + GenericBaseForms = 51, + LeveledBaseForms = 52, + Weathers = 53, + Cells = 54, + Worldspaces = 55, + Quests = 56, + Packages = 57, + CombatStyles = 58, + LoadScreens = 59, + AnimatedObjects = 60, + Waters = 61, + Debris = 62, + FormLists = 63, + Perks = 64, + ArmorAddons = 65, + Locations = 66, + DefaultObjects = 67, + Outfits = 68, + AimModels = 69, + AimAssistModels = 70, + Layers = 71, + ConstructibleObjects = 72, + ObjectModifications = 73, + InstanceNamingRules = 74, + AttractionRules = 75, + Resources = 76, + BiomeSwaps = 77, + SnapTemplates = 78, + Planets = 79, + ConditionRecords = 80, + SurfacePatternStyles = 81, + TerminalMenus = 82, + LegendaryItems = 83, + ActorValueModulations = 84, } #endregion @@ -5633,9 +5685,9 @@ internal partial class StarfieldMod_Registration : ILoquiRegistration public static ProtocolKey ProtocolKey => ProtocolDefinition_Starfield.ProtocolKey; - public const ushort AdditionalFieldCount = 84; + public const ushort AdditionalFieldCount = 85; - public const ushort FieldCount = 84; + public const ushort FieldCount = 85; public static readonly Type MaskType = typeof(StarfieldMod.Mask<>); @@ -5751,6 +5803,7 @@ public void Clear(IStarfieldMod item) item.Keys.Clear(); item.Ingestibles.Clear(); item.IdleMarkers.Clear(); + item.BiomeMarkers.Clear(); item.GenericBaseForms.Clear(); item.LeveledBaseForms.Clear(); item.Weathers.Clear(); @@ -5830,6 +5883,7 @@ public void RemapLinks(IStarfieldMod obj, IReadOnlyDictionary obj.Keys.RemapLinks(mapping); obj.Ingestibles.RemapLinks(mapping); obj.IdleMarkers.RemapLinks(mapping); + obj.BiomeMarkers.RemapLinks(mapping); obj.GenericBaseForms.RemapLinks(mapping); obj.LeveledBaseForms.RemapLinks(mapping); obj.Weathers.RemapLinks(mapping); @@ -5941,6 +5995,7 @@ public void Remove( obj.Keys.Remove(keys); obj.Ingestibles.Remove(keys); obj.IdleMarkers.Remove(keys); + obj.BiomeMarkers.Remove(keys); obj.GenericBaseForms.Remove(keys); obj.LeveledBaseForms.Remove(keys); obj.Weathers.Remove(keys); @@ -6406,6 +6461,14 @@ public void Remove( type: type, keys: keys); break; + case "BiomeMarker": + case "IBiomeMarkerGetter": + case "IBiomeMarker": + case "IBiomeMarkerInternal": + obj.BiomeMarkers.Remove( + type: type, + keys: keys); + break; case "GenericBaseForm": case "IGenericBaseFormGetter": case "IGenericBaseForm": @@ -6886,6 +6949,7 @@ public void Remove( break; case "INpcTemplateTarget": case "INpcTemplateTargetGetter": + Remove(obj, keys, typeof(IBiomeMarkerGetter), throwIfUnknown: throwIfUnknown); Remove(obj, keys, typeof(ILeveledNpcGetter), throwIfUnknown: throwIfUnknown); Remove(obj, keys, typeof(INpcGetter), throwIfUnknown: throwIfUnknown); break; @@ -7259,6 +7323,12 @@ public IEnumerable EnumerateListedAssetLinks(IStarfieldMod obj) yield return item; } } + { + foreach (var item in obj.BiomeMarkers.EnumerateListedAssetLinks()) + { + yield return item; + } + } if (obj.GenericBaseForms is IAssetLinkContainer GenericBaseFormslinkCont) { foreach (var item in GenericBaseFormslinkCont.EnumerateListedAssetLinks()) @@ -7419,6 +7489,7 @@ public void RemapAssetLinks( obj.Keys.RemapAssetLinks(mapping, queryCategories, linkCache); obj.Ingestibles.RemapAssetLinks(mapping, queryCategories, linkCache); obj.IdleMarkers.RemapAssetLinks(mapping, queryCategories, linkCache); + obj.BiomeMarkers.RemapAssetLinks(mapping, queryCategories, linkCache); obj.GenericBaseForms.RemapAssetLinks(mapping, queryCategories, linkCache); obj.LeveledBaseForms.RemapAssetLinks(mapping, queryCategories, linkCache); obj.Weathers.RemapAssetLinks(mapping, queryCategories, linkCache); @@ -7531,6 +7602,7 @@ public void FillEqualsMask( ret.Keys = MaskItemExt.Factory(item.Keys.GetEqualsMask(rhs.Keys, include), include); ret.Ingestibles = MaskItemExt.Factory(item.Ingestibles.GetEqualsMask(rhs.Ingestibles, include), include); ret.IdleMarkers = MaskItemExt.Factory(item.IdleMarkers.GetEqualsMask(rhs.IdleMarkers, include), include); + ret.BiomeMarkers = MaskItemExt.Factory(item.BiomeMarkers.GetEqualsMask(rhs.BiomeMarkers, include), include); ret.GenericBaseForms = MaskItemExt.Factory(item.GenericBaseForms.GetEqualsMask(rhs.GenericBaseForms, include), include); ret.LeveledBaseForms = MaskItemExt.Factory(item.LeveledBaseForms.GetEqualsMask(rhs.LeveledBaseForms, include), include); ret.Weathers = MaskItemExt.Factory(item.Weathers.GetEqualsMask(rhs.Weathers, include), include); @@ -7809,6 +7881,10 @@ protected static void ToStringFields( { item.IdleMarkers?.Print(sb, "IdleMarkers"); } + if (printMask?.BiomeMarkers?.Overall ?? true) + { + item.BiomeMarkers?.Print(sb, "BiomeMarkers"); + } if (printMask?.GenericBaseForms?.Overall ?? true) { item.GenericBaseForms?.Print(sb, "GenericBaseForms"); @@ -8354,6 +8430,14 @@ public virtual bool Equals( } else if (!isIdleMarkersEqual) return false; } + if ((equalsMask?.GetShouldTranslate((int)StarfieldMod_FieldIndex.BiomeMarkers) ?? true)) + { + if (EqualsMaskHelper.RefEquality(lhs.BiomeMarkers, rhs.BiomeMarkers, out var lhsBiomeMarkers, out var rhsBiomeMarkers, out var isBiomeMarkersEqual)) + { + if (!object.Equals(lhsBiomeMarkers, rhsBiomeMarkers)) return false; + } + else if (!isBiomeMarkersEqual) return false; + } if ((equalsMask?.GetShouldTranslate((int)StarfieldMod_FieldIndex.GenericBaseForms) ?? true)) { if (EqualsMaskHelper.RefEquality(lhs.GenericBaseForms, rhs.GenericBaseForms, out var lhsGenericBaseForms, out var rhsGenericBaseForms, out var isGenericBaseFormsEqual)) @@ -8682,6 +8766,7 @@ public virtual int GetHashCode(IStarfieldModGetter item) hash.Add(item.Keys); hash.Add(item.Ingestibles); hash.Add(item.IdleMarkers); + hash.Add(item.BiomeMarkers); hash.Add(item.GenericBaseForms); hash.Add(item.LeveledBaseForms); hash.Add(item.Weathers); @@ -8979,6 +9064,11 @@ public object GetNew() case "IIdleMarker": case "IIdleMarkerInternal": return obj.IdleMarkers; + case "BiomeMarker": + case "IBiomeMarkerGetter": + case "IBiomeMarker": + case "IBiomeMarkerInternal": + return obj.BiomeMarkers; case "GenericBaseForm": case "IGenericBaseFormGetter": case "IGenericBaseForm": @@ -9174,7 +9264,7 @@ public static void WriteParallel( mod: item, modHeader: item.ModHeader.DeepCopy(), modKey: modKey); - Stream[] outputStreams = new Stream[83]; + Stream[] outputStreams = new Stream[84]; List toDo = new List(); toDo.Add(() => WriteGroupParallel(item.GameSettings, 0, outputStreams, bundle, parallelParam)); toDo.Add(() => WriteGroupParallel(item.Keywords, 1, outputStreams, bundle, parallelParam)); @@ -9225,40 +9315,41 @@ public static void WriteParallel( toDo.Add(() => WriteGroupParallel(item.Keys, 46, outputStreams, bundle, parallelParam)); toDo.Add(() => WriteGroupParallel(item.Ingestibles, 47, outputStreams, bundle, parallelParam)); toDo.Add(() => WriteGroupParallel(item.IdleMarkers, 48, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.GenericBaseForms, 49, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.LeveledBaseForms, 50, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.Weathers, 51, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteCellsParallel(item.Cells, 52, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteWorldspacesParallel(item.Worldspaces, 53, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteQuestsParallel(item.Quests, 54, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.Packages, 55, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.CombatStyles, 56, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.LoadScreens, 57, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.AnimatedObjects, 58, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.Waters, 59, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.Debris, 60, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.FormLists, 61, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.Perks, 62, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.ArmorAddons, 63, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.Locations, 64, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.DefaultObjects, 65, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.Outfits, 66, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.AimModels, 67, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.AimAssistModels, 68, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.Layers, 69, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.ConstructibleObjects, 70, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.ObjectModifications, 71, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.InstanceNamingRules, 72, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.AttractionRules, 73, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.Resources, 74, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.BiomeSwaps, 75, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.SnapTemplates, 76, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.Planets, 77, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.ConditionRecords, 78, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.SurfacePatternStyles, 79, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.TerminalMenus, 80, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.LegendaryItems, 81, outputStreams, bundle, parallelParam)); - toDo.Add(() => WriteGroupParallel(item.ActorValueModulations, 82, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.BiomeMarkers, 49, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.GenericBaseForms, 50, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.LeveledBaseForms, 51, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.Weathers, 52, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteCellsParallel(item.Cells, 53, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteWorldspacesParallel(item.Worldspaces, 54, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteQuestsParallel(item.Quests, 55, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.Packages, 56, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.CombatStyles, 57, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.LoadScreens, 58, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.AnimatedObjects, 59, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.Waters, 60, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.Debris, 61, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.FormLists, 62, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.Perks, 63, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.ArmorAddons, 64, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.Locations, 65, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.DefaultObjects, 66, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.Outfits, 67, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.AimModels, 68, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.AimAssistModels, 69, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.Layers, 70, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.ConstructibleObjects, 71, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.ObjectModifications, 72, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.InstanceNamingRules, 73, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.AttractionRules, 74, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.Resources, 75, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.BiomeSwaps, 76, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.SnapTemplates, 77, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.Planets, 78, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.ConditionRecords, 79, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.SurfacePatternStyles, 80, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.TerminalMenus, 81, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.LegendaryItems, 82, outputStreams, bundle, parallelParam)); + toDo.Add(() => WriteGroupParallel(item.ActorValueModulations, 83, outputStreams, bundle, parallelParam)); Parallel.Invoke(parallelParam.ParallelOptions, toDo.ToArray()); PluginUtilityTranslation.CompileStreamsInto( outputStreams.NotNull(), @@ -9476,6 +9567,10 @@ public IEnumerable EnumerateFormLinks(IStarfieldModGetter obj) { yield return item; } + foreach (var item in obj.BiomeMarkers.EnumerateFormLinks()) + { + yield return item; + } foreach (var item in obj.GenericBaseForms.EnumerateFormLinks()) { yield return item; @@ -9798,6 +9893,10 @@ public IEnumerable EnumerateMajorRecords(IStarfieldModGetter { yield return item; } + foreach (var item in obj.BiomeMarkers.EnumerateMajorRecords()) + { + yield return item; + } foreach (var item in obj.GenericBaseForms.EnumerateMajorRecords()) { yield return item; @@ -10410,6 +10509,15 @@ public IEnumerable EnumerateMajorRecords( yield return item; } yield break; + case "BiomeMarker": + case "IBiomeMarkerGetter": + case "IBiomeMarker": + case "IBiomeMarkerInternal": + foreach (var item in obj.BiomeMarkers.EnumerateMajorRecords(type, throwIfUnknown: throwIfUnknown)) + { + yield return item; + } + yield break; case "GenericBaseForm": case "IGenericBaseFormGetter": case "IGenericBaseForm": @@ -11273,6 +11381,15 @@ public IEnumerable( + srcGroup: obj.BiomeMarkers, + type: typeof(IBiomeMarkerGetter), + modKey: obj.ModKey, + group: (m) => m.BiomeMarkers, + groupGetter: (m) => m.BiomeMarkers)) + { + yield return item; + } foreach (var item in InterfaceEnumerationHelper.EnumerateGroupContexts( srcGroup: obj.GenericBaseForms, type: typeof(IGenericBaseFormGetter), @@ -12320,6 +12437,20 @@ public IEnumerable( + srcGroup: obj.BiomeMarkers, + type: type, + modKey: obj.ModKey, + group: (m) => m.BiomeMarkers, + groupGetter: (m) => m.BiomeMarkers)) + { + yield return item; + } + yield break; case "GenericBaseForm": case "IGenericBaseFormGetter": case "IGenericBaseForm": @@ -13246,6 +13377,10 @@ public IEnumerable EnumerateAssetLinks(IStarfieldModGetter obj { yield return item; } + foreach (var item in obj.BiomeMarkers.EnumerateAssetLinks(queryCategories: queryCategories, linkCache: linkCache, assetType: assetType)) + { + yield return item; + } if (obj.GenericBaseForms is IAssetLinkContainerGetter GenericBaseFormslinkCont) { foreach (var item in GenericBaseFormslinkCont.EnumerateAssetLinks(queryCategories: queryCategories, linkCache: linkCache, assetType: assetType)) @@ -14369,6 +14504,26 @@ public void DeepCopyIn( errorMask?.PopIndex(); } } + if ((copyMask?.GetShouldTranslate((int)StarfieldMod_FieldIndex.BiomeMarkers) ?? true)) + { + errorMask?.PushIndex((int)StarfieldMod_FieldIndex.BiomeMarkers); + try + { + item.BiomeMarkers.DeepCopyIn( + rhs: rhs.BiomeMarkers, + errorMask: errorMask, + copyMask: copyMask?.GetSubCrystal((int)StarfieldMod_FieldIndex.BiomeMarkers)); + } + catch (Exception ex) + when (errorMask != null) + { + errorMask.ReportException(ex); + } + finally + { + errorMask?.PopIndex(); + } + } if ((copyMask?.GetShouldTranslate((int)StarfieldMod_FieldIndex.GenericBaseForms) ?? true)) { errorMask?.PushIndex((int)StarfieldMod_FieldIndex.GenericBaseForms); @@ -15188,6 +15343,7 @@ public class GroupMask public bool Keys; public bool Ingestibles; public bool IdleMarkers; + public bool BiomeMarkers; public bool GenericBaseForms; public bool LeveledBaseForms; public bool Weathers; @@ -15276,6 +15432,7 @@ public GroupMask(bool defaultValue) Keys = defaultValue; Ingestibles = defaultValue; IdleMarkers = defaultValue; + BiomeMarkers = defaultValue; GenericBaseForms = defaultValue; LeveledBaseForms = defaultValue; Weathers = defaultValue; @@ -15908,6 +16065,17 @@ public static void WriteRecordTypes( translationParams: translationParams); } } + if (importMask?.BiomeMarkers ?? true) + { + var BiomeMarkersItem = item.BiomeMarkers; + if (BiomeMarkersItem.RecordCache.Count > 0) + { + ((StarfieldGroupBinaryWriteTranslation)((IBinaryItem)BiomeMarkersItem).BinaryWriteTranslator).Write( + item: BiomeMarkersItem, + writer: writer, + translationParams: translationParams); + } + } if (importMask?.GenericBaseForms ?? true) { var GenericBaseFormsItem = item.GenericBaseForms; @@ -17028,6 +17196,20 @@ public static ParseResult FillBinaryRecordTypes( } return (int)StarfieldMod_FieldIndex.IdleMarkers; } + case RecordTypeInts.BMMO: + { + if (importMask?.BiomeMarkers ?? true) + { + item.BiomeMarkers.CopyInFromBinary( + frame: frame, + translationParams: null); + } + else + { + frame.Position += contentLength; + } + return (int)StarfieldMod_FieldIndex.BiomeMarkers; + } case RecordTypeInts.GBFM: { if (importMask?.GenericBaseForms ?? true) @@ -17920,6 +18102,11 @@ public void Dispose() private IStarfieldGroupGetter? _IdleMarkers => _IdleMarkersLocations != null ? StarfieldGroupBinaryOverlay.StarfieldGroupFactory(_stream, _IdleMarkersLocations, _package) : default; public IStarfieldGroupGetter IdleMarkers => _IdleMarkers ?? new StarfieldGroup(this); #endregion + #region BiomeMarkers + private List? _BiomeMarkersLocations; + private IStarfieldGroupGetter? _BiomeMarkers => _BiomeMarkersLocations != null ? StarfieldGroupBinaryOverlay.StarfieldGroupFactory(_stream, _BiomeMarkersLocations, _package) : default; + public IStarfieldGroupGetter BiomeMarkers => _BiomeMarkers ?? new StarfieldGroup(this); + #endregion #region GenericBaseForms private List? _GenericBaseFormsLocations; private IStarfieldGroupGetter? _GenericBaseForms => _GenericBaseFormsLocations != null ? StarfieldGroupBinaryOverlay.StarfieldGroupFactory(_stream, _GenericBaseFormsLocations, _package) : default; @@ -18478,6 +18665,12 @@ public ParseResult FillRecordType( _IdleMarkersLocations.Add(new RangeInt64((stream.Position - offset), finalPos - offset)); return (int)StarfieldMod_FieldIndex.IdleMarkers; } + case RecordTypeInts.BMMO: + { + _BiomeMarkersLocations ??= new(); + _BiomeMarkersLocations.Add(new RangeInt64((stream.Position - offset), finalPos - offset)); + return (int)StarfieldMod_FieldIndex.BiomeMarkers; + } case RecordTypeInts.GBFM: { _GenericBaseFormsLocations ??= new(); diff --git a/Mutagen.Bethesda.Starfield/Records/TypeSolidifier_Generated.cs b/Mutagen.Bethesda.Starfield/Records/TypeSolidifier_Generated.cs index d72da7bf3..544b7dbf5 100644 --- a/Mutagen.Bethesda.Starfield/Records/TypeSolidifier_Generated.cs +++ b/Mutagen.Bethesda.Starfield/Records/TypeSolidifier_Generated.cs @@ -612,9 +612,9 @@ public static TypedLoadOrderAccess /// ModListings to query /// A typed object to do further queries on BiomeMarker - public static TypedLoadOrderAccess BiomeMarker(this IEnumerable> listings) + public static TopLevelTypedLoadOrderAccess BiomeMarker(this IEnumerable> listings) { - return new TypedLoadOrderAccess( + return new TopLevelTypedLoadOrderAccess( (bool includeDeletedRecords) => listings.WinningOverrides(includeDeletedRecords: includeDeletedRecords), (ILinkCache linkCache, bool includeDeletedRecords) => listings.WinningContextOverrides(linkCache, includeDeletedRecords: includeDeletedRecords)); } @@ -624,9 +624,9 @@ public static TypedLoadOrderAccess /// Mods to query /// A typed object to do further queries on BiomeMarker - public static TypedLoadOrderAccess BiomeMarker(this IEnumerable mods) + public static TopLevelTypedLoadOrderAccess BiomeMarker(this IEnumerable mods) { - return new TypedLoadOrderAccess( + return new TopLevelTypedLoadOrderAccess( (bool includeDeletedRecords) => mods.WinningOverrides(includeDeletedRecords: includeDeletedRecords), (ILinkCache linkCache, bool includeDeletedRecords) => mods.WinningContextOverrides(linkCache, includeDeletedRecords: includeDeletedRecords)); }