TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
QuestMenu Class Reference

#include <GossipDef.h>

Public Member Functions

uint8 GetMenuItemCount () const
 
bool Empty () const
 
QuestMenuItem constGetItem (uint16 index) const
 
AddMenuItem

Adds a localized gossip menu item from db by menu id and menu item id.

Parameters
menuIdGossip menu id.
menuItemIdGossip menu item id.
senderIdentifier of the current menu.
actionCustom action given to OnGossipHello.
 QuestMenu ()
 
 ~QuestMenu ()
 
void AddMenuItem (uint32 QuestId, uint8 Icon)
 
void ClearMenu ()
 
bool HasItem (uint32 questId) const
 

Private Attributes

QuestMenuItemList _questMenuItems
 

Constructor & Destructor Documentation

QuestMenu::QuestMenu ( )
294 {
295  _questMenuItems.reserve(16); // can be set for max from most often sizes to speedup push_back and less memory use
296 }
QuestMenuItemList _questMenuItems
Definition: GossipDef.h:233
QuestMenu::~QuestMenu ( )
299 {
300  ClearMenu();
301 }
void ClearMenu()
Definition: GossipDef.cpp:327

+ Here is the call graph for this function:

Member Function Documentation

void QuestMenu::AddMenuItem ( uint32  QuestId,
uint8  Icon 
)
304 {
305  if (!sObjectMgr->GetQuestTemplate(QuestId))
306  return;
307 
309 
310  QuestMenuItem questMenuItem;
311 
312  questMenuItem.QuestId = QuestId;
313  questMenuItem.QuestIcon = Icon;
314 
315  _questMenuItems.push_back(questMenuItem);
316 }
Definition: GossipDef.h:153
#define sObjectMgr
Definition: ObjectMgr.h:1567
#define GOSSIP_MAX_MENU_ITEMS
Definition: GossipDef.h:29
#define ASSERT
Definition: Errors.h:55
QuestMenuItemList _questMenuItems
Definition: GossipDef.h:233
uint32 QuestId
Definition: GossipDef.h:155

+ Here is the caller graph for this function:

void QuestMenu::ClearMenu ( )
328 {
329  _questMenuItems.clear();
330 }
QuestMenuItemList _questMenuItems
Definition: GossipDef.h:233

+ Here is the caller graph for this function:

bool QuestMenu::Empty ( ) const
inline
228 { return _questMenuItems.empty(); }
QuestMenuItemList _questMenuItems
Definition: GossipDef.h:233
QuestMenuItem const& QuestMenu::GetItem ( uint16  index) const
inline
230 { return _questMenuItems[index]; }
QuestMenuItemList _questMenuItems
Definition: GossipDef.h:233

+ Here is the caller graph for this function:

uint8 QuestMenu::GetMenuItemCount ( ) const
inline
227 { return uint8(_questMenuItems.size()); }
uint8_t uint8
Definition: g3dmath.h:164
QuestMenuItemList _questMenuItems
Definition: GossipDef.h:233

+ Here is the caller graph for this function:

bool QuestMenu::HasItem ( uint32  questId) const
319 {
320  for (QuestMenuItemList::const_iterator i = _questMenuItems.begin(); i != _questMenuItems.end(); ++i)
321  if (i->QuestId == questId)
322  return true;
323 
324  return false;
325 }
QuestMenuItemList _questMenuItems
Definition: GossipDef.h:233

Member Data Documentation

QuestMenuItemList QuestMenu::_questMenuItems
private

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