diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-09 12:56:02 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-09 12:56:02 +0000 |
commit | 8a9e607d36b9b22cfb22002a3bbeb1bf86810337 (patch) | |
tree | 032f20fff6f1371548d279c7cfad8e550ca75128 /src/net/tradehandler.cpp | |
parent | 76185faa619fd06576f2e67e1f2d5f1fb659e340 (diff) | |
download | mana-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.cpp | 18 |
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: |