using ODMO.Commons.Models.Base;
using ODMO.Commons.Writers;
namespace ODMO.Commons.Packets.PersonalShop
{
public class LoadConsignedShopWarehousePacket : PacketWriter
{
private const int PacketNumber = 1523;
///
/// Pop up the personal shop window.
///
/// The target action enum to choose the shop type
/// The item id used to open the shop
public LoadConsignedShopWarehousePacket(ItemListModel consignedWarehouse)
{
Type(PacketNumber);
WriteInt(consignedWarehouse.RetrieveEnabled);
WriteInt64(consignedWarehouse.Bits);
WriteUInt(consignedWarehouse.Count);
foreach (var item in consignedWarehouse.Items.Where(x => x.ItemId > 0))
{
WriteBytes(item.ToArray());
}
}
}
}