Rename some collection stuff.

This commit is contained in:
Ottermandias 2022-08-13 21:18:21 +02:00
parent f264725c45
commit 8aefdbd948
9 changed files with 51 additions and 35 deletions

View file

@ -1,13 +1,9 @@
using System;
using Penumbra.GameData.Enums;
using Penumbra.GameData.Util;
namespace Penumbra.GameData.Structs;
public unsafe struct CharacterArmorData
{
public fixed byte Data[40];
}
public readonly unsafe struct CharacterEquip
{
public static readonly CharacterEquip Null = new(null);
@ -26,7 +22,6 @@ public readonly unsafe struct CharacterEquip
public ref CharacterArmor this[ EquipSlot slot ]
=> ref _armor[ IndexOf( slot ) ];
public ref CharacterArmor Head
=> ref _armor[ 0 ];
@ -108,4 +103,12 @@ public readonly unsafe struct CharacterEquip
_ => throw new ArgumentOutOfRangeException( nameof( slot ), slot, null ),
};
}
public void Write( IntPtr target )
{
Functions.MemCpyUnchecked( ( void* )target, _armor, sizeof( CharacterArmor ) * 10 );
}
public bool Equals( CharacterEquip other )
=> Functions.MemCmpUnchecked( ( void* )_armor, ( void* )other._armor, sizeof( CharacterArmor ) * 10 ) == 0;
}