summaryrefslogtreecommitdiff
path: root/src/net/tradehandler.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2006-03-09 12:56:02 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2006-03-09 12:56:02 +0000
commit8a9e607d36b9b22cfb22002a3bbeb1bf86810337 (patch)
tree032f20fff6f1371548d279c7cfad8e550ca75128 /src/net/tradehandler.cpp
parent76185faa619fd06576f2e67e1f2d5f1fb659e340 (diff)
downloadmana-8a9e607d36b9b22cfb22002a3bbeb1bf86810337.tar.gz
mana-8a9e607d36b9b22cfb22002a3bbeb1bf86810337.tar.bz2
mana-8a9e607d36b9b22cfb22002a3bbeb1bf86810337.tar.xz
mana-8a9e607d36b9b22cfb22002a3bbeb1bf86810337.zip
Made all local action listeners structs and moved them into anonymous namespaces.
Diffstat (limited to 'src/net/tradehandler.cpp')
-rw-r--r--src/net/tradehandler.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/net/tradehandler.cpp b/src/net/tradehandler.cpp
index c3fd6d4b..5bce0574 100644
--- a/src/net/tradehandler.cpp
+++ b/src/net/tradehandler.cpp
@@ -38,13 +38,15 @@ std::string tradePartnerName;
/**
* Listener for request trade dialogs
*/
-struct RequestTradeListener : public gcn::ActionListener
-{
- void action(const std::string& eventId)
+namespace {
+ struct RequestTradeListener : public gcn::ActionListener
{
- player_node->tradeReply(eventId == "yes");
- };
-} requestTradeListener;
+ void action(const std::string& eventId)
+ {
+ player_node->tradeReply(eventId == "yes");
+ };
+ } listener;
+}
TradeHandler::TradeHandler()
{
@@ -77,14 +79,14 @@ void TradeHandler::handleMessage(MessageIn *msg)
player_node->tradeReply(false);
break;
}
-
+
player_node->setTrading(true);
tradePartnerName = msg->readString(24);
ConfirmDialog *dlg;
dlg = new ConfirmDialog("Request for trade",
tradePartnerName +
" wants to trade with you, do you accept?");
- dlg->addActionListener(&requestTradeListener);
+ dlg->addActionListener(&listener);
break;
case SMSG_TRADE_RESPONSE: