Planeshift
PlayerToNPCExchange Class Reference

#include <exchangemanager.h>

Public Member Functions

bool CheckExchange (uint32_t clientNum, bool checkRange=false)
 
virtual void DeleteObjectCallback (iDeleteNotificationObject *object)
 
gemObjectGetTargetGEM ()
 
virtual bool HandleAccept (Client *client)
 One of the client has accepted the exchange. More...
 
virtual void HandleEnd (Client *client)
 One of the clients has ended this exchange. More...
 
 PlayerToNPCExchange (Client *starter, gemObject *target, bool automaticExchange, int questID, ExchangeManager *manager)
 
virtual ~PlayerToNPCExchange ()
 
- Public Member Functions inherited from Exchange
virtual bool AddItem (Client *fromClient, INVENTORY_SLOT_NUMBER fromSlot, int stackCount, int toSlot)
 Add a new item to the exchange. More...
 
virtual bool AdjustMoney (Client *client, int moneyType, int newMoney)
 
virtual bool AdjustMoney (Client *client, const psMoney &money)
 
bool CheckRange (int clientNum, gemObject *ourActor, gemObject *otherActor)
 
 Exchange (Client *starter, bool automaticExchange, ExchangeManager *manager)
 
int GetID () const
 
virtual psMoney GetOfferedMoney (Client *client)
 
ClientGetStarterClient ()
 
psItemGetStarterOffer (int slot)
 
virtual psItemGetTargetOffer (int slot)
 
virtual void MoveItem (Client *client, int fromSlot, int stackCount, int toSlot)
 Move an item from one slot to another in the exchange. More...
 
virtual bool RemoveItem (Client *fromClient, int slot, int stackCount)
 Removes an item from the exchange. More...
 
virtual ~Exchange ()
 
- Public Member Functions inherited from iDeleteObjectCallback
virtual ~iDeleteObjectCallback ()
 

Protected Member Functions

bool CheckXMLResponse (Client *client, psNPCDialog *dlg, csString trigger)
 A check to se if a exchange trigger trigg any response from the npc. More...
 
- Protected Member Functions inherited from Exchange
virtual void SendAddItemMessage (Client *fromClient, int slot, psCharacterInventory::psCharacterInventoryItem *item)
 
void SendEnd (int clientNum)
 
virtual void SendRemoveItemMessage (Client *fromClient, int slot)
 

Protected Attributes

int questID
 
gemObjecttarget
 
- Protected Attributes inherited from Exchange
bool automaticExchange
 the exchange is done entirely server side don't open windows on the client. This is used only with NPC! More...
 
bool exchangeEnded
 exchange ended and should be deleted More...
 
ExchangeManagerexchangeMgr
 
bool exchangeSuccess
 exchange was successful and items should not be returned to owners More...
 
int id
 unique exchange ID More...
 
uint32_t player
 
ExchangingCharacter starterChar
 Information about the player that initiated the exchange. More...
 
ClientstarterClient
 

Additional Inherited Members

- Static Protected Attributes inherited from Exchange
static int next_id
 

Detailed Description

Definition at line 384 of file exchangemanager.h.

Constructor & Destructor Documentation

PlayerToNPCExchange::PlayerToNPCExchange ( Client starter,
gemObject target,
bool  automaticExchange,
int  questID,
ExchangeManager manager 
)
virtual PlayerToNPCExchange::~PlayerToNPCExchange ( )
virtual

Member Function Documentation

bool PlayerToNPCExchange::CheckExchange ( uint32_t  clientNum,
bool  checkRange = false 
)
bool PlayerToNPCExchange::CheckXMLResponse ( Client client,
psNPCDialog dlg,
csString  trigger 
)
protected

A check to se if a exchange trigger trigg any response from the npc.

Parameters
clientThe client
dlgThe dialog of the selected NPC
triggerA XML string of the items exchanged.
Returns
Return true if a trigger was run with sucess.
virtual void PlayerToNPCExchange::DeleteObjectCallback ( iDeleteNotificationObject object)
virtual

Implements iDeleteObjectCallback.

gemObject* PlayerToNPCExchange::GetTargetGEM ( )
virtual bool PlayerToNPCExchange::HandleAccept ( Client client)
virtual

One of the client has accepted the exchange.

If both clients have accepted the exchange will end and the items will be exchanged.

Parameters
clientThe client that has accepted the exchange.
Returns
true If the exchange has ended.

Implements Exchange.

virtual void PlayerToNPCExchange::HandleEnd ( Client client)
virtual

One of the clients has ended this exchange.

This will close the exchange on both the clients without transfer of items.

Parameters
clientThe client that has ended the exchange.

Implements Exchange.

Member Data Documentation

int PlayerToNPCExchange::questID
protected

Definition at line 409 of file exchangemanager.h.

gemObject* PlayerToNPCExchange::target
protected

Definition at line 408 of file exchangemanager.h.


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