TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
VendorItemData Struct Reference

#include <Creature.h>

Public Member Functions

VendorItem * GetItem (uint32 slot) const
 
bool Empty () const
 
uint32 GetItemCount () const
 
void AddItem (uint32 item, int32 maxcount, uint32 ptime, uint32 ExtendedCost, uint8 type)
 
bool RemoveItem (uint32 item_id, uint8 type)
 
VendorItem const * FindItemCostPair (uint32 item_id, uint32 extendedCost, uint8 type) const
 
void Clear ()
 

Public Attributes

VendorItemList m_items
 

Member Function Documentation

void VendorItemData::AddItem ( uint32  item,
int32  maxcount,
uint32  ptime,
uint32  ExtendedCost,
uint8  type 
)
inline
397  {
398  m_items.push_back(new VendorItem(item, maxcount, ptime, ExtendedCost, type));
399  }
Definition: Creature.h:367
VendorItemList m_items
Definition: Creature.h:385

+ Here is the caller graph for this function:

void VendorItemData::Clear ( )
inline
403  {
404  for (VendorItemList::const_iterator itr = m_items.begin(); itr != m_items.end(); ++itr)
405  delete (*itr);
406  m_items.clear();
407  }
VendorItemList m_items
Definition: Creature.h:385
bool VendorItemData::Empty ( ) const
inline
394 { return m_items.empty(); }
VendorItemList m_items
Definition: Creature.h:385
VendorItem const * VendorItemData::FindItemCostPair ( uint32  item_id,
uint32  extendedCost,
uint8  type 
) const
79 {
80  for (VendorItemList::const_iterator i = m_items.begin(); i != m_items.end(); ++i)
81  if ((*i)->item == item_id && (*i)->ExtendedCost == extendedCost && (*i)->Type == type)
82  return *i;
83  return NULL;
84 }
arena_t NULL
Definition: jemalloc_internal.h:624
VendorItemList m_items
Definition: Creature.h:385

+ Here is the caller graph for this function:

VendorItem* VendorItemData::GetItem ( uint32  slot) const
inline
388  {
389  if (slot >= m_items.size())
390  return NULL;
391 
392  return m_items[slot];
393  }
arena_t NULL
Definition: jemalloc_internal.h:624
VendorItemList m_items
Definition: Creature.h:385

+ Here is the caller graph for this function:

uint32 VendorItemData::GetItemCount ( ) const
inline
395 { return uint32(m_items.size()); }
VendorItemList m_items
Definition: Creature.h:385
uint32_t uint32
Definition: g3dmath.h:168

+ Here is the caller graph for this function:

bool VendorItemData::RemoveItem ( uint32  item_id,
uint8  type 
)
63 {
64  bool found = false;
65  for (VendorItemList::iterator i = m_items.begin(); i != m_items.end();)
66  {
67  if ((*i)->item == item_id && (*i)->Type == type)
68  {
69  i = m_items.erase(i++);
70  found = true;
71  }
72  else
73  ++i;
74  }
75  return found;
76 }
VendorItemList m_items
Definition: Creature.h:385

Member Data Documentation

VendorItemList VendorItemData::m_items

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