TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
WorldPackets::NPC::VendorInventory Class Referencefinal

#include <NPCPackets.h>

Public Member Functions

 VendorInventory ()
 
WorldPacket constWrite () override
 
- Public Member Functions inherited from WorldPackets::ServerPacket
 ServerPacket (OpcodeServer opcode, size_t initialSize=200, ConnectionType connection=CONNECTION_TYPE_DEFAULT)
 
void Read () overridefinal
 
void Clear ()
 
WorldPacket && Move ()
 
OpcodeServer GetOpcode () const
 
- Public Member Functions inherited from WorldPackets::Packet
 Packet (WorldPacket &&worldPacket)
 
virtual ~Packet ()=default
 
 Packet (Packet const &right)=delete
 
Packetoperator= (Packet const &right)=delete
 
WorldPacket constGetRawPacket () const
 
size_t GetSize () const
 
ConnectionType GetConnection () const
 

Public Attributes

uint8 Reason = 0
 
std::vector< VendorItemItems
 
ObjectGuid Vendor
 

Additional Inherited Members

- Protected Attributes inherited from WorldPackets::Packet
WorldPacket _worldPacket
 

Constructor & Destructor Documentation

WorldPackets::NPC::VendorInventory::VendorInventory ( )
inline
ServerPacket(OpcodeServer opcode, size_t initialSize=200, ConnectionType connection=CONNECTION_TYPE_DEFAULT)
Definition: Packet.h:49
Definition: Opcodes.h:1610

Member Function Documentation

WorldPacket const * WorldPackets::NPC::VendorInventory::Write ( )
overridevirtual

Implements WorldPackets::Packet.

69 {
72 
73  _worldPacket << int32(Items.size());
74  for (VendorItem const& item : Items)
75  {
76  _worldPacket << item.MuID;
77  _worldPacket << item.Type;
78  _worldPacket << item.Item;
79  _worldPacket << item.Quantity;
80  _worldPacket << item.Price;
81  _worldPacket << item.Durability;
82  _worldPacket << item.StackCount;
83  _worldPacket << item.ExtendedCostID;
84  _worldPacket << item.PlayerConditionFailed;
85 
86  _worldPacket.WriteBit(item.DoNotFilterOnVendor);
88  }
89 
90  return &_worldPacket;
91 }
std::vector< VendorItem > Items
Definition: NPCPackets.h:126
ObjectGuid Vendor
Definition: NPCPackets.h:127
void FlushBits()
Definition: ByteBuffer.h:150
WorldPacket _worldPacket
Definition: Packet.h:43
bool WriteBit(uint32 bit)
Definition: ByteBuffer.h:170
Definition: Creature.h:367
uint8 Reason
Definition: NPCPackets.h:125
int32_t int32
Definition: g3dmath.h:167

+ Here is the caller graph for this function:

Member Data Documentation

std::vector<VendorItem> WorldPackets::NPC::VendorInventory::Items
uint8 WorldPackets::NPC::VendorInventory::Reason = 0
ObjectGuid WorldPackets::NPC::VendorInventory::Vendor

The documentation for this class was generated from the following files: