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

Public Member Functions

 LootGroupInvalidSelector (Loot const &loot, uint16 lootMode)
 
bool operator() (LootStoreItem *item) const
 

Private Attributes

Loot const_loot
 
uint16 _lootMode
 

Constructor & Destructor Documentation

LootGroupInvalidSelector::LootGroupInvalidSelector ( Loot const loot,
uint16  lootMode 
)
inlineexplicit
59 : _loot(loot), _lootMode(lootMode) { }
Loot const & _loot
Definition: LootMgr.cpp:76
uint16 _lootMode
Definition: LootMgr.cpp:77

Member Function Documentation

bool LootGroupInvalidSelector::operator() ( LootStoreItem item) const
inline
62  {
63  if (!(item->lootmode & _lootMode))
64  return true;
65 
66  uint8 foundDuplicates = 0;
67  for (std::vector<LootItem>::const_iterator itr = _loot.items.begin(); itr != _loot.items.end(); ++itr)
68  if (itr->itemid == item->itemid)
69  if (++foundDuplicates == _loot.maxDuplicates)
70  return true;
71 
72  return false;
73  }
uint16 lootmode
Definition: LootMgr.h:139
uint32 itemid
Definition: LootMgr.h:136
Loot const & _loot
Definition: LootMgr.cpp:76
uint16 _lootMode
Definition: LootMgr.cpp:77
uint8 maxDuplicates
Definition: LootMgr.h:326
std::vector< LootItem > items
Definition: LootMgr.h:320
uint8_t uint8
Definition: Define.h:152

Member Data Documentation

Loot const& LootGroupInvalidSelector::_loot
private
uint16 LootGroupInvalidSelector::_lootMode
private

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