mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 10:17:22 +01:00
Add some Write options to ActorEquipment.
This commit is contained in:
parent
af11267400
commit
44bbf546f6
1 changed files with 36 additions and 13 deletions
|
|
@ -123,5 +123,28 @@ namespace Penumbra.GameData.Structs
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
public unsafe void WriteBytes( byte[] array, int offset = 0 )
|
||||
{
|
||||
fixed( ActorWeapon* data = &MainHand )
|
||||
{
|
||||
Marshal.Copy( new IntPtr( data ), array, offset, 56 );
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] ToBytes()
|
||||
{
|
||||
var ret = new byte[56];
|
||||
WriteBytes( ret );
|
||||
return ret;
|
||||
}
|
||||
|
||||
public unsafe void FromBytes( byte[] array, int offset = 0 )
|
||||
{
|
||||
fixed( ActorWeapon* data = &MainHand )
|
||||
{
|
||||
Marshal.Copy( array, offset, new IntPtr( data ), 56 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue