Add interop for Actor and Model.

This commit is contained in:
Ottermandias 2023-11-25 23:54:37 +01:00
parent 6f4a7661d7
commit 512d0a1a5f
6 changed files with 98 additions and 27 deletions

View file

@ -80,7 +80,8 @@ public class ActorState
/// <summary> This contains whether a change to the base data was made by the game, the user via manual input or through automatic application. </summary>
private readonly StateChanged.Source[] _sources = Enumerable
.Repeat(StateChanged.Source.Game, EquipFlagExtensions.NumEquipFlags + CustomizationExtensions.NumIndices + 5).ToArray();
.Repeat(StateChanged.Source.Game,
EquipFlagExtensions.NumEquipFlags + CustomizationExtensions.NumIndices + 5 + CrestExtensions.AllRelevantSet.Count).ToArray();
internal ActorState(ActorIdentifier identifier)
=> Identifier = identifier.CreatePermanent();
@ -88,6 +89,9 @@ public class ActorState
public ref StateChanged.Source this[EquipSlot slot, bool stain]
=> ref _sources[slot.ToIndex() + (stain ? EquipFlagExtensions.NumEquipFlags / 2 : 0)];
public ref StateChanged.Source this[CrestFlag slot]
=> ref _sources[EquipFlagExtensions.NumEquipFlags + CustomizationExtensions.NumIndices + 5 + slot.ToRelevantIndex()];
public ref StateChanged.Source this[CustomizeIndex type]
=> ref _sources[EquipFlagExtensions.NumEquipFlags + (int)type];