|
| BankMoveItemData (Guild *guild, Player *player, uint8 container, uint8 slotId) |
|
bool | IsBank () const override |
|
bool | InitItem () override |
|
bool | HasStoreRights (MoveItemData *pOther) const override |
|
bool | HasWithdrawRights (MoveItemData *pOther) const override |
|
void | RemoveItem (SQLTransaction &trans, MoveItemData *pOther, uint32 splitedAmount) override |
|
Item * | StoreItem (SQLTransaction &trans, Item *pItem) override |
|
void | LogBankEvent (SQLTransaction &trans, MoveItemData *pFrom, uint32 count) const override |
|
void | LogAction (MoveItemData *pFrom) const override |
|
| MoveItemData (Guild *guild, Player *player, uint8 container, uint8 slotId) |
|
virtual | ~MoveItemData () |
|
virtual bool | CheckItem (uint32 &splitedAmount) |
|
bool | CanStore (Item *pItem, bool swap, bool sendError) |
|
bool | CloneItem (uint32 count) |
|
void | CopySlots (SlotIds &ids) const |
|
Item * | GetItem (bool isCloned=false) const |
|
uint8 | GetContainer () const |
|
uint8 | GetSlotId () const |
|
|
Item * | _StoreItem (SQLTransaction &trans, BankTab *pTab, Item *pItem, ItemPosCount &pos, bool clone) const |
|
bool | _ReserveSpace (uint8 slotId, Item *pItem, Item *pItemDest, uint32 &count) |
|
void | CanStoreItemInTab (Item *pItem, uint8 skipSlotId, bool merge, uint32 &count) |
|
Guild::BankMoveItemData::BankMoveItemData |
( |
Guild * |
guild, |
|
|
Player * |
player, |
|
|
uint8 |
container, |
|
|
uint8 |
slotId |
|
) |
| |
|
inline |
MoveItemData(Guild *guild, Player *player, uint8 container, uint8 slotId)
Definition: Guild.h:663
957 requiredSpace -= pItemDest->
GetCount();
960 requiredSpace =
std::min(requiredSpace, count);
963 ItemPosCount pos(slotId, requiredSpace);
964 if (!pos.isContainedIn(
m_vec))
966 m_vec.push_back(pos);
967 count -= requiredSpace;
uint32 GetCount() const
Definition: Item.h:322
uint32 GetMaxStackCount() const
Definition: Item.h:324
T min(const T &x, const T &y)
Definition: g3dmath.h:305
uint32_t uint32
Definition: Define.h:150
ItemPosCountVec m_vec
Definition: Guild.h:704
uint32 GetEntry() const
Definition: Object.h:107
920 if (
Item* pItemDest = pTab->GetItem(slotId))
922 pItemDest->SetCount(pItemDest->GetCount() + count);
924 pItemDest->SaveToDB(trans);
939 if (pItem && pTab->SetItem(trans, slotId, pItem))
Item * CloneItem(uint32 count, Player const *player=NULL) const
Definition: Item.cpp:1095
arena_t NULL
Definition: jemalloc_internal.h:624
void SetCount(uint32 value)
Definition: Item.cpp:794
uint32_t uint32
Definition: Define.h:150
virtual void RemoveFromWorld()
Definition: Object.cpp:156
uint8_t uint8
Definition: g3dmath.h:164
static void DeleteFromDB(SQLTransaction &trans, ObjectGuid::LowType itemGuid)
Definition: Item.cpp:518
uint8_t uint8
Definition: Define.h:152
Implements Guild::MoveItemData.
994 TC_LOG_DEBUG(
"guild",
"GUILD STORAGE: CanStore() tab = %u, slot = %u, item = %u, count = %u",
1011 if ((pItemDest == pItem) || swap)
Item * _GetItem(uint8 tabId, uint8 slotId) const
Definition: Guild.cpp:3044
uint32 GetCount() const
Definition: Item.h:322
bool IsSoulBound() const
Definition: Item.h:277
uint32 GetMaxStackCount() const
Definition: Item.h:324
arena_t NULL
Definition: jemalloc_internal.h:624
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
uint8 _GetPurchasedTabsSize() const
Definition: Guild.h:920
bool _ReserveSpace(uint8 slotId, Item *pItem, Item *pItemDest, uint32 &count)
Definition: Guild.cpp:949
uint32_t uint32
Definition: Define.h:150
uint8 m_slotId
Definition: Guild.h:701
void CanStoreItemInTab(Item *pItem, uint8 skipSlotId, bool merge, uint32 &count)
Definition: Guild.cpp:972
uint8 m_container
Definition: Guild.h:700
uint32 GetEntry() const
Definition: Object.h:107
Guild * m_pGuild
Definition: Guild.h:698
void Guild::BankMoveItemData::CanStoreItemInTab |
( |
Item * |
pItem, |
|
|
uint8 |
skipSlotId, |
|
|
bool |
merge, |
|
|
uint32 & |
count |
|
) |
| |
|
private |
974 for (
uint8 slotId = 0; (slotId < GUILD_BANK_MAX_SLOTS) && (count > 0); ++slotId)
977 if (slotId == skipSlotId)
981 if (pItemDest == pItem)
985 if ((pItemDest !=
NULL) != merge)
Item * _GetItem(uint8 tabId, uint8 slotId) const
Definition: Guild.cpp:3044
arena_t NULL
Definition: jemalloc_internal.h:624
bool _ReserveSpace(uint8 slotId, Item *pItem, Item *pItemDest, uint32 &count)
Definition: Guild.cpp:949
uint8 m_container
Definition: Guild.h:700
uint8_t uint8
Definition: Define.h:152
Guild * m_pGuild
Definition: Guild.h:698
Reimplemented from Guild::MoveItemData.
830 if (pOther->IsBank() && pOther->GetContainer() ==
m_container)
Player * m_pPlayer
Definition: Guild.h:699
bool _MemberHasTabRights(ObjectGuid guid, uint8 tabId, int32 rights) const
Definition: Guild.cpp:3000
uint8 m_container
Definition: Guild.h:700
#define ASSERT
Definition: Errors.h:55
Guild * m_pGuild
Definition: Guild.h:698
Reimplemented from Guild::MoveItemData.
839 if (pOther->IsBank() && pOther->GetContainer() ==
m_container)
const Member * GetMember(ObjectGuid guid) const
Definition: Guild.h:924
Player * m_pPlayer
Definition: Guild.h:699
int32 _GetMemberRemainingSlots(Member const *member, uint8 tabId) const
Definition: Guild.cpp:2954
int32_t int32
Definition: Define.h:146
uint8 m_container
Definition: Guild.h:700
#define ASSERT
Definition: Errors.h:55
Guild * m_pGuild
Definition: Guild.h:698
bool Guild::BankMoveItemData::InitItem |
( |
| ) |
|
|
overridevirtual |
Implements Guild::MoveItemData.
Item * _GetItem(uint8 tabId, uint8 slotId) const
Definition: Guild.cpp:3044
arena_t NULL
Definition: jemalloc_internal.h:624
Item * m_pItem
Definition: Guild.h:702
uint8 m_slotId
Definition: Guild.h:701
uint8 m_container
Definition: Guild.h:700
Guild * m_pGuild
Definition: Guild.h:698
bool Guild::BankMoveItemData::IsBank |
( |
| ) |
const |
|
inlineoverridevirtual |
void Guild::BankMoveItemData::LogAction |
( |
MoveItemData * |
pFrom | ) |
const |
|
overridevirtual |
- Todo:
- Move this to scripts
Reimplemented from Guild::MoveItemData.
909 "GM %s (%s) (Account: %u) deposit item: %s (Entry: %d Count: %u) to guild bank named: %s (Guild ID: " UI64FMTD ")",
911 pFrom->GetItem()->GetTemplate()->GetDefaultLocaleName(), pFrom->GetItem()->GetEntry(), pFrom->GetItem()->GetCount(),
std::string const & GetName() const
Definition: Guild.h:766
#define sLog
Definition: Log.h:154
Player * m_pPlayer
Definition: Guild.h:699
#define UI64FMTD
Definition: Define.h:137
ObjectGuid::LowType GetId() const
Definition: Guild.h:763
virtual void LogAction(MoveItemData *pFrom) const
Definition: Guild.cpp:745
Guild * m_pGuild
Definition: Guild.h:698
Implements Guild::MoveItemData.
900 pFrom->GetItem()->GetEntry(), count);
Player * m_pPlayer
Definition: Guild.h:699
uint8 m_container
Definition: Guild.h:700
#define ASSERT
Definition: Errors.h:55
void _LogBankEvent(SQLTransaction &trans, GuildBankEventLogTypes eventType, uint8 tabId, ObjectGuid::LowType playerGuid, uint64 itemOrMoney, uint16 itemStackCount=0, uint8 destTabId=0)
Definition: Guild.cpp:3023
Guild * m_pGuild
Definition: Guild.h:698
Implements Guild::MoveItemData.
864 if (!pOther->IsBank() || pOther->GetContainer() !=
m_container)
uint32 GetCount() const
Definition: Item.h:322
void _UpdateMemberWithdrawSlots(SQLTransaction &trans, ObjectGuid guid, uint8 tabId)
Definition: Guild.cpp:2989
void FSetState(ItemUpdateState state)
Definition: Item.h:377
void _RemoveItem(SQLTransaction &trans, uint8 tabId, uint8 slotId)
Definition: Guild.cpp:3051
arena_t NULL
Definition: jemalloc_internal.h:624
void SetCount(uint32 value)
Definition: Item.cpp:794
Item * m_pItem
Definition: Guild.h:702
virtual void SaveToDB(SQLTransaction &trans)
Definition: Item.cpp:311
Player * m_pPlayer
Definition: Guild.h:699
uint8 m_slotId
Definition: Guild.h:701
uint8 m_container
Definition: Guild.h:700
#define ASSERT
Definition: Errors.h:55
Guild * m_pGuild
Definition: Guild.h:698
Implements Guild::MoveItemData.
877 Item* pLastItem = pItem;
878 for (ItemPosCountVec::const_iterator itr =
m_vec.begin(); itr !=
m_vec.end(); )
880 ItemPosCount pos(*itr);
883 TC_LOG_DEBUG(
"guild",
"GUILD STORAGE: StoreItem tab = %u, slot = %u, item = %u, count = %u",
uint32 GetCount() const
Definition: Item.h:322
arena_t NULL
Definition: jemalloc_internal.h:624
BankTab * GetBankTab(uint8 tabId)
Definition: Guild.h:921
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Item * _StoreItem(SQLTransaction &trans, BankTab *pTab, Item *pItem, ItemPosCount &pos, bool clone) const
Definition: Guild.cpp:916
uint8 m_slotId
Definition: Guild.h:701
ItemPosCountVec m_vec
Definition: Guild.h:704
uint8 m_container
Definition: Guild.h:700
uint32 GetEntry() const
Definition: Object.h:107
Guild * m_pGuild
Definition: Guild.h:698
The documentation for this class was generated from the following files: