using ODMO.Commons.Enums.ClientEnums;
using ODMO.Commons.Models.TamerShop;
using ODMO.Commons.Writers;
namespace ODMO.Commons.Packets.PersonalShop
{
public class LoadConsignedShopPacket : PacketWriter
{
private const int PacketNumber = 1006;
///
/// Shows the target consigned shop on the map.
///
/// The consigned shop to be showed.
public LoadConsignedShopPacket(ConsignedShop consignedShop)
{
Type(PacketNumber);
WriteByte(3);
WriteShort(1);
WriteInt(consignedShop.Location.X);
WriteInt(consignedShop.Location.Y);
WriteUInt(consignedShop.GeneralHandler);
WriteFloat(0);
WriteInt(0);
WriteInt(consignedShop.ItemId);
WriteString(consignedShop.ShopName);
WriteByte(0);
}
///
/// Shows the consigned shop list on the map.
///
/// The consigned shop list to be loaded.
public LoadConsignedShopPacket(IList consignedShopList)
{
Type(PacketNumber);
WriteByte(3);
WriteShort((short)consignedShopList.Count);
foreach (var consignedShop in consignedShopList)
{
WriteInt(consignedShop.Location.X);
WriteInt(consignedShop.Location.Y);
WriteInt64(consignedShop.GeneralHandler);
WriteShort((short)consignedShop.Location.X);
WriteShort((short)consignedShop.Location.Y);
WriteInt(consignedShop.ItemId);
WriteString(consignedShop.ShopName);
}
WriteInt(0);
}
}
}