AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Guild::MoveItemData Class Referenceabstract
Inheritance diagram for Guild::MoveItemData:
Guild::BankMoveItemData Guild::PlayerMoveItemData

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 (CharacterDatabaseTransaction trans, MoveItemData *pOther, uint32 splitedAmount=0)=0
 
virtual ItemStoreItem (CharacterDatabaseTransaction trans, Item *pItem)=0
 
virtual void LogBankEvent (CharacterDatabaseTransaction 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
 

Detailed Description

Constructor & Destructor Documentation

◆ MoveItemData()

Guild::MoveItemData::MoveItemData ( Guild guild,
Player player,
uint8  container,
uint8  slotId 
)
inline
592 : m_pGuild(guild), m_pPlayer(player),
593 m_container(container), m_slotId(slotId), m_pItem(nullptr), m_pClonedItem(nullptr) { }
Item * m_pClonedItem
Definition: Guild.h:632
Player * m_pPlayer
Definition: Guild.h:628
uint8 m_slotId
Definition: Guild.h:630
Guild * m_pGuild
Definition: Guild.h:627
Item * m_pItem
Definition: Guild.h:631
uint8 m_container
Definition: Guild.h:629

◆ ~MoveItemData()

virtual Guild::MoveItemData::~MoveItemData ( )
inlinevirtual
594{ }

Member Function Documentation

◆ CanStore() [1/2]

virtual InventoryResult Guild::MoveItemData::CanStore ( Item pItem,
bool  swap 
)
protectedpure virtual

◆ CanStore() [2/2]

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}
InventoryResult
Definition: Item.h:46
@ EQUIP_ERR_OK
Definition: Item.h:47
void SendEquipError(InventoryResult msg, Item *pItem, Item *pItem2=nullptr, uint32 itemid=0)
Definition: PlayerStorage.cpp:4021
ItemPosCountVec m_vec
Definition: Guild.h:633
bool CanStore(Item *pItem, bool swap, bool sendError)
Definition: Guild.cpp:724

References EQUIP_ERR_OK.

Referenced by Guild::_DoItemsMove().

◆ CheckItem()

bool Guild::MoveItemData::CheckItem ( uint32 splitedAmount)
virtual
715{
717 if (splitedAmount > m_pItem->GetCount())
718 return false;
719 if (splitedAmount == m_pItem->GetCount())
720 splitedAmount = 0;
721 return true;
722}
#define ASSERT
Definition: Errors.h:68
uint32 GetCount() const
Definition: Item.h:272

References ASSERT.

Referenced by Guild::_MoveItems().

◆ CloneItem()

bool Guild::MoveItemData::CloneItem ( uint32  count)
734{
737 if (!m_pClonedItem)
738 {
740 return false;
741 }
742 return true;
743}
@ EQUIP_ERR_ITEM_NOT_FOUND
Definition: Item.h:70
Item * CloneItem(uint32 count, Player const *player=nullptr) const
Definition: Item.cpp:1118

References ASSERT, and EQUIP_ERR_ITEM_NOT_FOUND.

Referenced by Guild::_MoveItems().

◆ CopySlots()

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}
std::uint8_t uint8
Definition: Define.h:109

Referenced by Guild::_SendBankContentUpdate().

◆ GetContainer()

◆ GetItem()

Item * Guild::MoveItemData::GetItem ( bool  isCloned = false) const
inline

◆ GetSlotId()

uint8 Guild::MoveItemData::GetSlotId ( ) const
inline
622{ return m_slotId; }

References m_slotId.

Referenced by Guild::_SendBankContentUpdate(), and LogAction().

◆ HasStoreRights()

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

Reimplemented in Guild::BankMoveItemData.

602{ return true; }

Referenced by Guild::_MoveItems().

◆ HasWithdrawRights()

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

Reimplemented in Guild::BankMoveItemData.

604{ return true; }

Referenced by Guild::_MoveItems().

◆ InitItem()

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

◆ IsBank()

◆ LogAction()

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(),
752}
#define sScriptMgr
Definition: ScriptMgr.h:709
uint8 GetSlotId() const
Definition: Guild.h:622
uint8 GetContainer() const
Definition: Guild.h:621
virtual bool IsBank() const =0

References ASSERT, GetContainer(), GetItem(), GetSlotId(), IsBank(), and sScriptMgr.

Referenced by Guild::_DoItemsMove(), and Guild::BankMoveItemData::LogAction().

◆ LogBankEvent()

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

◆ RemoveItem()

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

◆ StoreItem()

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

Member Data Documentation

◆ m_container

uint8 Guild::MoveItemData::m_container
protected

Referenced by GetContainer().

◆ m_pClonedItem

Item* Guild::MoveItemData::m_pClonedItem
protected

Referenced by GetItem().

◆ m_pGuild

Guild* Guild::MoveItemData::m_pGuild
protected

◆ m_pItem

Item* Guild::MoveItemData::m_pItem
protected

Referenced by GetItem().

◆ m_pPlayer

Player* Guild::MoveItemData::m_pPlayer
protected

◆ m_slotId

uint8 Guild::MoveItemData::m_slotId
protected

Referenced by GetSlotId().

◆ m_vec

ItemPosCountVec Guild::MoveItemData::m_vec
protected