TradeWindow Class Reference
[User interface related classes (windows, dialogs)]

#include <trade.h>

Inheritance diagram for TradeWindow:

Window

List of all members.


Detailed Description

Trade dialog.

Definition at line 44 of file trade.h.


Public Member Functions

 TradeWindow ()
 Constructor.
 ~TradeWindow ()
 Destructor.
void setMoney (int quantity)
 Displays expected money in the trade window.
void addItem (int id, bool own, int quantity)
 Add an item to the trade window.
void reset ()
 Reset both item containers.
void addItem (int id, bool own, int quantity, bool equipment)
 Add an item to the trade window.
void changeQuantity (int index, bool own, int quantity)
 Change quantity of an item.
void increaseQuantity (int index, bool own, int quantity)
 Increase quantity of an item.
void receivedOk (bool own)
 Player received ok message from server.
void tradeItem (Item *item, int quantity)
 Send trade packet.
void valueChanged (const gcn::SelectionEvent &event)
 Updates the labels and makes sure only one item is selected in either my inventory or partner inventory.
void action (const gcn::ActionEvent &event)
 Called when receiving actions from the widgets.
void close ()
 Closes the Trade Window, as well as telling the server that the window has been closed.

Private Types

enum  Status { PREPARING, PROPOSING, ACCEPTING, ACCEPTED }
typedef const std::auto_ptr
< Inventory
InventoryPtr

Private Member Functions

void setStatus (Status s)
 Sets the current status of the trade.

Private Attributes

InventoryPtr mMyInventory
InventoryPtr mPartnerInventory
ItemContainermMyItemContainer
ItemContainermPartnerItemContainer
gcn::Label * mMoneyLabel
gcn::Button * mAddButton
gcn::Button * mOkButton
gcn::Button * mMoneyChangeButton
gcn::TextField * mMoneyField
Status mStatus
bool mOkOther
bool mOkMe

Member Typedef Documentation

typedef const std::auto_ptr<Inventory> TradeWindow::InventoryPtr [private]

Definition at line 128 of file trade.h.


Member Enumeration Documentation

enum TradeWindow::Status [private]

Enumerator:
PREPARING  Players are adding items.

(1)

PROPOSING  Local player has confirmed the trade.

(1)

ACCEPTING  Accepting the trade.

(2)

ACCEPTED  Local player has accepted the trade.

Definition at line 115 of file trade.h.


Constructor & Destructor Documentation

TradeWindow::TradeWindow (  ) 

Constructor.

Definition at line 57 of file trade.cpp.

TradeWindow::~TradeWindow (  ) 

Destructor.

Definition at line 126 of file trade.cpp.


Member Function Documentation

void TradeWindow::setMoney ( int  quantity  ) 

Displays expected money in the trade window.

Definition at line 130 of file trade.cpp.

void TradeWindow::addItem ( int  id,
bool  own,
int  quantity 
)

Add an item to the trade window.

Definition at line 137 of file trade.cpp.

void TradeWindow::reset (  ) 

Reset both item containers.

Definition at line 170 of file trade.cpp.

void TradeWindow::addItem ( int  id,
bool  own,
int  quantity,
bool  equipment 
)

Add an item to the trade window.

Definition at line 142 of file trade.cpp.

void TradeWindow::changeQuantity ( int  index,
bool  own,
int  quantity 
)

Change quantity of an item.

Definition at line 154 of file trade.cpp.

void TradeWindow::increaseQuantity ( int  index,
bool  own,
int  quantity 
)

Increase quantity of an item.

Definition at line 162 of file trade.cpp.

void TradeWindow::receivedOk ( bool  own  ) 

Player received ok message from server.

Definition at line 184 of file trade.cpp.

void TradeWindow::tradeItem ( Item item,
int  quantity 
)

Send trade packet.

Definition at line 199 of file trade.cpp.

void TradeWindow::valueChanged ( const gcn::SelectionEvent &  event  ) 

Updates the labels and makes sure only one item is selected in either my inventory or partner inventory.

Definition at line 204 of file trade.cpp.

void TradeWindow::action ( const gcn::ActionEvent &  event  ) 

Called when receiving actions from the widgets.

Definition at line 249 of file trade.cpp.

void TradeWindow::close (  )  [virtual]

Closes the Trade Window, as well as telling the server that the window has been closed.

Reimplemented from Window.

Definition at line 327 of file trade.cpp.

void TradeWindow::setStatus ( Status  s  )  [private]

Sets the current status of the trade.

Definition at line 218 of file trade.cpp.


Member Data Documentation

Definition at line 129 of file trade.h.

Definition at line 130 of file trade.h.

Definition at line 132 of file trade.h.

Definition at line 133 of file trade.h.

gcn::Label* TradeWindow::mMoneyLabel [private]

Definition at line 135 of file trade.h.

gcn::Button* TradeWindow::mAddButton [private]

Definition at line 136 of file trade.h.

gcn::Button* TradeWindow::mOkButton [private]

Definition at line 137 of file trade.h.

gcn::Button* TradeWindow::mMoneyChangeButton [private]

Definition at line 138 of file trade.h.

gcn::TextField* TradeWindow::mMoneyField [private]

Definition at line 139 of file trade.h.

Definition at line 141 of file trade.h.

bool TradeWindow::mOkOther [private]

Definition at line 142 of file trade.h.

bool TradeWindow::mOkMe [private]

Definition at line 142 of file trade.h.


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

Generated on Sun Apr 26 17:30:44 2009 for The Mana World by  doxygen 1.5.5