AzerothCore 3.3.5a
OpenSource WoW Emulator
|
#include "TradeData.h"
Public Member Functions | |
TradeData (Player *player, Player *trader) | |
Player * | GetTrader () const |
TradeData * | GetTraderData () const |
Item * | GetItem (TradeSlots slot) const |
bool | HasItem (ObjectGuid itemGuid) const |
TradeSlots | GetTradeSlotForItem (ObjectGuid itemGuid) const |
void | SetItem (TradeSlots slot, Item *item) |
uint32 | GetSpell () const |
void | SetSpell (uint32 spell_id, Item *castItem=nullptr) |
Item * | GetSpellCastItem () const |
bool | HasSpellCastItem () const |
uint32 | GetMoney () const |
void | SetMoney (uint32 money) |
bool | IsAccepted () const |
void | SetAccepted (bool state, bool crosssend=false) |
bool | IsInAcceptProcess () const |
void | SetInAcceptProcess (bool state) |
Private Member Functions | |
void | Update (bool for_trader=true) |
Private Attributes | |
Player * | m_player |
Player * | m_trader |
bool | m_accepted |
bool | m_acceptProccess |
uint32 | m_money |
uint32 | m_spell |
ObjectGuid | m_spellCastItem |
ObjectGuid | m_items [TRADE_SLOT_COUNT] |
Item * TradeData::GetItem | ( | TradeSlots | slot | ) | const |
References Player::GetItemByGuid(), m_items, and m_player.
Referenced by WorldSession::HandleAcceptTradeOpcode(), WorldSession::SendUpdateTrade(), and setAcceptTradeMode().
|
inline |
Referenced by WorldSession::HandleAcceptTradeOpcode(), and WorldSession::SendUpdateTrade().
|
inline |
Referenced by Spell::CheckCast(), WorldSession::HandleAcceptTradeOpcode(), and WorldSession::SendUpdateTrade().
Item * TradeData::GetSpellCastItem | ( | ) | const |
References Player::GetItemByGuid(), m_player, and m_spellCastItem.
Referenced by WorldSession::HandleAcceptTradeOpcode().
|
inline |
TradeData * TradeData::GetTraderData | ( | ) | const |
References Player::GetTradeData(), and m_trader.
Referenced by WorldSession::SendUpdateTrade(), SetItem(), SetMoney(), and SetSpell().
TradeSlots TradeData::GetTradeSlotForItem | ( | ObjectGuid | itemGuid | ) | const |
References m_items, TRADE_SLOT_COUNT, and TRADE_SLOT_INVALID.
bool TradeData::HasItem | ( | ObjectGuid | itemGuid | ) | const |
References m_items, and TRADE_SLOT_COUNT.
Referenced by WorldSession::HandleSetTradeItemOpcode().
|
inline |
Referenced by WorldSession::HandleAcceptTradeOpcode().
|
inline |
Referenced by WorldSession::HandleAcceptTradeOpcode().
|
inline |
void TradeData::SetAccepted | ( | bool | state, |
bool | crosssend = false |
||
) |
References Player::GetSession(), m_accepted, m_player, m_trader, WorldSession::SendTradeStatus(), and TRADE_STATUS_BACK_TO_TRADE.
Referenced by WorldSession::HandleAcceptTradeOpcode(), WorldSession::HandleUnacceptTradeOpcode(), SetItem(), SetMoney(), and SetSpell().
|
inline |
Referenced by clearAcceptTradeMode(), and setAcceptTradeMode().
void TradeData::SetItem | ( | TradeSlots | slot, |
Item * | item | ||
) |
References ObjectGuid::Empty, Object::GetGUID(), GetTraderData(), m_items, SetAccepted(), SetSpell(), TRADE_SLOT_NONTRADED, and Update().
Referenced by WorldSession::HandleClearTradeItemOpcode(), and WorldSession::HandleSetTradeItemOpcode().
void TradeData::SetMoney | ( | uint32 | money | ) |
References Player::GetSession(), GetTraderData(), Player::HasEnoughMoney(), m_money, m_player, WorldSession::SendTradeStatus(), SetAccepted(), TRADE_STATUS_BUSY, and Update().
Referenced by WorldSession::HandleSetTradeGoldOpcode().
References ObjectGuid::Empty, Object::GetGUID(), GetTraderData(), m_spell, m_spellCastItem, SetAccepted(), and Update().
Referenced by WorldSession::HandleAcceptTradeOpcode(), and SetItem().
|
private |
References Player::GetSession(), m_player, m_trader, and WorldSession::SendUpdateTrade().
Referenced by SetItem(), SetMoney(), and SetSpell().
|
private |
Referenced by SetAccepted().
|
private |
|
private |
Referenced by GetItem(), GetTradeSlotForItem(), HasItem(), and SetItem().
|
private |
Referenced by SetMoney().
|
private |
Referenced by GetItem(), GetSpellCastItem(), SetAccepted(), SetMoney(), and Update().
|
private |
Referenced by SetSpell().
|
private |
Referenced by GetSpellCastItem(), and SetSpell().
|
private |
Referenced by GetTraderData(), SetAccepted(), and Update().