TrinityCore
TradeData Class Reference

#include <TradeData.h>

Public Member Functions

 TradeData (Player *player, Player *trader)
 
PlayerGetTrader () const
 
TradeDataGetTraderData () const
 
ItemGetItem (TradeSlots slot) const
 
bool HasItem (ObjectGuid itemGuid) const
 
TradeSlots GetTradeSlotForItem (ObjectGuid itemGuid) const
 
void SetItem (TradeSlots slot, Item *item, bool update=false)
 
uint32 GetSpell () const
 
void SetSpell (uint32 spell_id, Item *castItem=nullptr)
 
ItemGetSpellCastItem () const
 
bool HasSpellCastItem () const
 
uint64 GetMoney () const
 
void SetMoney (uint64 money)
 
bool IsAccepted () const
 
void SetAccepted (bool state, bool forTrader=false)
 
bool IsInAcceptProcess () const
 
void SetInAcceptProcess (bool state)
 
uint32 GetClientStateIndex () const
 
void UpdateClientStateIndex ()
 
uint32 GetServerStateIndex () const
 
void UpdateServerStateIndex ()
 

Private Member Functions

void Update (bool for_trader=true) const
 

Private Attributes

Player_player
 
Player_trader
 
bool _accepted
 
bool _acceptProccess
 
uint64 _money
 
uint32 _spell
 
ObjectGuid _spellCastItem
 
ObjectGuid _items [TRADE_SLOT_COUNT]
 
uint32 _clientStateIndex
 
uint32 _serverStateIndex
 

Detailed Description

Definition at line 34 of file TradeData.h.

Constructor & Destructor Documentation

◆ TradeData()

TradeData::TradeData ( Player player,
Player trader 
)
inline

Definition at line 37 of file TradeData.h.

Member Function Documentation

◆ GetClientStateIndex()

uint32 TradeData::GetClientStateIndex ( ) const
inline

Definition at line 64 of file TradeData.h.

+ Here is the caller graph for this function:

◆ GetItem()

Item * TradeData::GetItem ( TradeSlots  slot) const

Definition at line 30 of file TradeData.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetMoney()

uint64 TradeData::GetMoney ( ) const
inline

Definition at line 55 of file TradeData.h.

+ Here is the caller graph for this function:

◆ GetServerStateIndex()

uint32 TradeData::GetServerStateIndex ( ) const
inline

Definition at line 67 of file TradeData.h.

+ Here is the caller graph for this function:

◆ GetSpell()

uint32 TradeData::GetSpell ( ) const
inline

Definition at line 49 of file TradeData.h.

+ Here is the caller graph for this function:

◆ GetSpellCastItem()

Item * TradeData::GetSpellCastItem ( ) const

Definition at line 53 of file TradeData.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetTrader()

Player * TradeData::GetTrader ( ) const
inline

Definition at line 41 of file TradeData.h.

+ Here is the caller graph for this function:

◆ GetTraderData()

TradeData * TradeData::GetTraderData ( ) const

Definition at line 25 of file TradeData.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetTradeSlotForItem()

TradeSlots TradeData::GetTradeSlotForItem ( ObjectGuid  itemGuid) const

Definition at line 44 of file TradeData.cpp.

◆ HasItem()

bool TradeData::HasItem ( ObjectGuid  itemGuid) const

Definition at line 35 of file TradeData.cpp.

+ Here is the caller graph for this function:

◆ HasSpellCastItem()

bool TradeData::HasSpellCastItem ( ) const
inline

Definition at line 53 of file TradeData.h.

+ Here is the caller graph for this function:

◆ IsAccepted()

bool TradeData::IsAccepted ( ) const
inline

Definition at line 58 of file TradeData.h.

+ Here is the caller graph for this function:

◆ IsInAcceptProcess()

bool TradeData::IsInAcceptProcess ( ) const
inline

Definition at line 61 of file TradeData.h.

◆ SetAccepted()

void TradeData::SetAccepted ( bool  state,
bool  forTrader = false 
)

Definition at line 135 of file TradeData.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetInAcceptProcess()

void TradeData::SetInAcceptProcess ( bool  state)
inline

Definition at line 62 of file TradeData.h.

+ Here is the caller graph for this function:

◆ SetItem()

void TradeData::SetItem ( TradeSlots  slot,
Item item,
bool  update = false 
)

Definition at line 58 of file TradeData.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetMoney()

void TradeData::SetMoney ( uint64  money)

Definition at line 103 of file TradeData.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetSpell()

void TradeData::SetSpell ( uint32  spell_id,
Item castItem = nullptr 
)

Definition at line 84 of file TradeData.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Update()

void TradeData::Update ( bool  for_trader = true) const
private

Definition at line 127 of file TradeData.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateClientStateIndex()

void TradeData::UpdateClientStateIndex ( )
inline

Definition at line 65 of file TradeData.h.

+ Here is the caller graph for this function:

◆ UpdateServerStateIndex()

void TradeData::UpdateServerStateIndex ( )

Definition at line 150 of file TradeData.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ _accepted

bool TradeData::_accepted
private

Definition at line 76 of file TradeData.h.

◆ _acceptProccess

bool TradeData::_acceptProccess
private

Definition at line 77 of file TradeData.h.

◆ _clientStateIndex

uint32 TradeData::_clientStateIndex
private

Definition at line 86 of file TradeData.h.

◆ _items

ObjectGuid TradeData::_items[TRADE_SLOT_COUNT]
private

Definition at line 84 of file TradeData.h.

◆ _money

uint64 TradeData::_money
private

Definition at line 79 of file TradeData.h.

◆ _player

Player* TradeData::_player
private

Definition at line 73 of file TradeData.h.

◆ _serverStateIndex

uint32 TradeData::_serverStateIndex
private

Definition at line 87 of file TradeData.h.

◆ _spell

uint32 TradeData::_spell
private

Definition at line 81 of file TradeData.h.

◆ _spellCastItem

ObjectGuid TradeData::_spellCastItem
private

Definition at line 82 of file TradeData.h.

◆ _trader

Player* TradeData::_trader
private

Definition at line 74 of file TradeData.h.


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