#include <trade.h>
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 |
ItemContainer * | mMyItemContainer |
ItemContainer * | mPartnerItemContainer |
gcn::Label * | mMoneyLabel |
gcn::Button * | mAddButton |
gcn::Button * | mOkButton |
gcn::Button * | mMoneyChangeButton |
gcn::TextField * | mMoneyField |
Status | mStatus |
bool | mOkOther |
bool | mOkMe |
Member Typedef Documentation
Member Enumeration Documentation
- 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 |
( |
|
) |
|
TradeWindow::~TradeWindow |
( |
|
) |
|
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 |
) |
|
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
The documentation for this class was generated from the following files: