TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Guild::MoveItemData Class Referenceabstract

Public Member Functions

 MoveItemData (Guild *guild, Player *player, uint8 container, uint8 slotId)
 
virtual ~MoveItemData ()
 
virtual bool IsBank () const =0
 
virtual bool InitItem ()=0
 
virtual bool CheckItem (uint32 &splitedAmount)
 
virtual bool HasStoreRights (MoveItemData *) const
 
virtual bool HasWithdrawRights (MoveItemData *) const
 
bool CanStore (Item *pItem, bool swap, bool sendError)
 
bool CloneItem (uint32 count)
 
virtual void RemoveItem (SQLTransaction &trans, MoveItemData *pOther, uint32 splitedAmount=0)=0
 
virtual ItemStoreItem (SQLTransaction &trans, Item *pItem)=0
 
virtual void LogBankEvent (SQLTransaction &trans, MoveItemData *pFrom, uint32 count) const =0
 
virtual void LogAction (MoveItemData *pFrom) const
 
void CopySlots (SlotIds &ids) const
 
ItemGetItem (bool isCloned=false) const
 
uint8 GetContainer () const
 
uint8 GetSlotId () const
 

Protected Member Functions

virtual InventoryResult CanStore (Item *pItem, bool swap)=0
 

Protected Attributes

Guildm_pGuild
 
Playerm_pPlayer
 
uint8 m_container
 
uint8 m_slotId
 
Itemm_pItem
 
Itemm_pClonedItem
 
ItemPosCountVec m_vec
 

Constructor & Destructor Documentation

Guild::MoveItemData::MoveItemData ( Guild guild,
Player player,
uint8  container,
uint8  slotId 
)
inline
663  : m_pGuild(guild), m_pPlayer(player),
664  m_container(container), m_slotId(slotId), m_pItem(NULL), m_pClonedItem(NULL) { }
arena_t NULL
Definition: jemalloc_internal.h:624
Item * m_pItem
Definition: Guild.h:702
Player * m_pPlayer
Definition: Guild.h:699
Item * m_pClonedItem
Definition: Guild.h:703
uint8 m_slotId
Definition: Guild.h:701
uint8 m_container
Definition: Guild.h:700
Guild * m_pGuild
Definition: Guild.h:698
virtual Guild::MoveItemData::~MoveItemData ( )
inlinevirtual
665 { }

Member Function Documentation

bool Guild::MoveItemData::CanStore ( Item pItem,
bool  swap,
bool  sendError 
)
725 {
726  m_vec.clear();
727  InventoryResult msg = CanStore(pItem, swap);
728  if (sendError && msg != EQUIP_ERR_OK)
729  m_pPlayer->SendEquipError(msg, pItem);
730  return (msg == EQUIP_ERR_OK);
731 }
Player * m_pPlayer
Definition: Guild.h:699
Definition: Item.h:48
ItemPosCountVec m_vec
Definition: Guild.h:704
InventoryResult
Definition: Item.h:46
bool CanStore(Item *pItem, bool swap, bool sendError)
Definition: Guild.cpp:724

+ Here is the caller graph for this function:

virtual InventoryResult Guild::MoveItemData::CanStore ( Item pItem,
bool  swap 
)
protectedpure virtual
bool Guild::MoveItemData::CheckItem ( uint32 splitedAmount)
virtual
715 {
716  ASSERT(m_pItem);
717  if (splitedAmount > m_pItem->GetCount())
718  return false;
719  if (splitedAmount == m_pItem->GetCount())
720  splitedAmount = 0;
721  return true;
722 }
uint32 GetCount() const
Definition: Item.h:322
Item * m_pItem
Definition: Guild.h:702
#define ASSERT
Definition: Errors.h:55

+ Here is the caller graph for this function:

bool Guild::MoveItemData::CloneItem ( uint32  count)
734 {
735  ASSERT(m_pItem);
736  m_pClonedItem = m_pItem->CloneItem(count);
737  if (!m_pClonedItem)
738  {
739  m_pPlayer->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, m_pItem);
740  return false;
741  }
742  return true;
743 }
Item * CloneItem(uint32 count, Player const *player=NULL) const
Definition: Item.cpp:1095
Item * m_pItem
Definition: Guild.h:702
Player * m_pPlayer
Definition: Guild.h:699
Definition: Item.h:71
Item * m_pClonedItem
Definition: Guild.h:703
#define ASSERT
Definition: Errors.h:55

+ Here is the caller graph for this function:

void Guild::MoveItemData::CopySlots ( SlotIds ids) const
inline
755 {
756  for (ItemPosCountVec::const_iterator itr = m_vec.begin(); itr != m_vec.end(); ++itr)
757  ids.insert(uint8(itr->pos));
758 }
ItemPosCountVec m_vec
Definition: Guild.h:704
uint8_t uint8
Definition: Define.h:152

+ Here is the caller graph for this function:

uint8 Guild::MoveItemData::GetContainer ( ) const
inline
692 { return m_container; }
uint8 m_container
Definition: Guild.h:700

+ Here is the caller graph for this function:

Item* Guild::MoveItemData::GetItem ( bool  isCloned = false) const
inline
691 { return isCloned ? m_pClonedItem : m_pItem; }
Item * m_pItem
Definition: Guild.h:702
Item * m_pClonedItem
Definition: Guild.h:703

+ Here is the caller graph for this function:

uint8 Guild::MoveItemData::GetSlotId ( ) const
inline
693 { return m_slotId; }
uint8 m_slotId
Definition: Guild.h:701

+ Here is the caller graph for this function:

virtual bool Guild::MoveItemData::HasStoreRights ( MoveItemData ) const
inlinevirtual

Reimplemented in Guild::BankMoveItemData.

673 { return true; }

+ Here is the caller graph for this function:

virtual bool Guild::MoveItemData::HasWithdrawRights ( MoveItemData ) const
inlinevirtual

Reimplemented in Guild::BankMoveItemData.

675 { return true; }

+ Here is the caller graph for this function:

virtual bool Guild::MoveItemData::InitItem ( )
pure virtual

Implemented in Guild::BankMoveItemData, and Guild::PlayerMoveItemData.

+ Here is the caller graph for this function:

virtual bool Guild::MoveItemData::IsBank ( ) const
pure virtual

Implemented in Guild::BankMoveItemData, and Guild::PlayerMoveItemData.

+ Here is the caller graph for this function:

void Guild::MoveItemData::LogAction ( MoveItemData pFrom) const
virtual

Reimplemented in Guild::BankMoveItemData.

746 {
747  ASSERT(pFrom->GetItem());
748 
749  sScriptMgr->OnGuildItemMove(m_pGuild, m_pPlayer, pFrom->GetItem(),
750  pFrom->IsBank(), pFrom->GetContainer(), pFrom->GetSlotId(),
751  IsBank(), GetContainer(), GetSlotId());
752 }
Player * m_pPlayer
Definition: Guild.h:699
uint8 GetSlotId() const
Definition: Guild.h:693
uint8 GetContainer() const
Definition: Guild.h:692
#define ASSERT
Definition: Errors.h:55
#define sScriptMgr
Definition: ScriptMgr.h:837
virtual bool IsBank() const =0
Guild * m_pGuild
Definition: Guild.h:698

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual void Guild::MoveItemData::LogBankEvent ( SQLTransaction trans,
MoveItemData pFrom,
uint32  count 
) const
pure virtual

Implemented in Guild::BankMoveItemData, and Guild::PlayerMoveItemData.

+ Here is the caller graph for this function:

virtual void Guild::MoveItemData::RemoveItem ( SQLTransaction trans,
MoveItemData pOther,
uint32  splitedAmount = 0 
)
pure virtual

Implemented in Guild::BankMoveItemData, and Guild::PlayerMoveItemData.

+ Here is the caller graph for this function:

virtual Item* Guild::MoveItemData::StoreItem ( SQLTransaction trans,
Item pItem 
)
pure virtual

Implemented in Guild::BankMoveItemData, and Guild::PlayerMoveItemData.

+ Here is the caller graph for this function:

Member Data Documentation

uint8 Guild::MoveItemData::m_container
protected
Item* Guild::MoveItemData::m_pClonedItem
protected
Guild* Guild::MoveItemData::m_pGuild
protected
Item* Guild::MoveItemData::m_pItem
protected
Player* Guild::MoveItemData::m_pPlayer
protected
uint8 Guild::MoveItemData::m_slotId
protected
ItemPosCountVec Guild::MoveItemData::m_vec
protected

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