public BoxItem() { boxitem = new CollectionBoxItem(); boxitem.Potential = new ushort[5] { 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF }; boxitem.Effect = new ushort[4] { 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF }; boxitem.ID = 0xFFFF; }
public BoxItem(BinaryReader SaveDataFile) { int CollectionBasketStructSize = Marshal.SizeOf(typeof(CollectionBoxItem)); byte[] readBuffer = new byte[CollectionBasketStructSize]; SaveDataFile.Read(readBuffer, 0, CollectionBasketStructSize); GCHandle handle = GCHandle.Alloc(readBuffer, GCHandleType.Pinned); boxitem = (CollectionBoxItem)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(CollectionBoxItem)); handle.Free(); }