mirror of
https://github.com/kwsch/NHSE.git
synced 2026-04-22 16:37:30 -05:00
27 lines
870 B
C#
27 lines
870 B
C#
using System.ComponentModel;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace NHSE.Core;
|
|
|
|
[StructLayout(LayoutKind.Explicit, Size = SIZE, Pack = 1)]
|
|
[TypeConverter(typeof(ValueTypeTypeConverter))]
|
|
public struct GSaveItemName
|
|
{
|
|
public const int SIZE = 0x08;
|
|
public override string ToString() => UniqueID.ToString();
|
|
|
|
[field: FieldOffset(0x00)] public ushort UniqueID { get; set; }
|
|
[field: FieldOffset(0x02)] public byte SystemParam { get; set; }
|
|
[field: FieldOffset(0x03)] public byte AdditionalParam { get; set; }
|
|
[field: FieldOffset(0x04)] public int FreeParam { get; set; }
|
|
|
|
public Item ToItem() => this.ToBytes().ToClass<Item>();
|
|
|
|
public void CopyFrom(Item item)
|
|
{
|
|
UniqueID = item.ItemId;
|
|
SystemParam = item.SystemParam;
|
|
AdditionalParam = item.AdditionalParam;
|
|
FreeParam = item.FreeParam;
|
|
}
|
|
} |