summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-17 00:32:31 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-17 00:32:31 +0300
commitc841447e5196a34f62860189b0960d78a0ce1ced (patch)
treee5f05710175f701377cedd9345488726d0224c33
parente5698022dfae8aec4c9b4696dc6a93d5edc84d5d (diff)
downloadplus-c841447e5196a34f62860189b0960d78a0ce1ced.tar.gz
plus-c841447e5196a34f62860189b0960d78a0ce1ced.tar.bz2
plus-c841447e5196a34f62860189b0960d78a0ce1ced.tar.xz
plus-c841447e5196a34f62860189b0960d78a0ce1ced.zip
Remove getter for buySellHandler.
-rw-r--r--src/gui/popups/popupmenu.cpp8
-rw-r--r--src/gui/windows/buydialog.cpp2
-rw-r--r--src/gui/windows/buyselldialog.cpp4
-rw-r--r--src/gui/windows/selldialog.cpp2
-rw-r--r--src/net/buysellhandler.h2
-rw-r--r--src/net/net.cpp6
-rw-r--r--src/net/net.h2
7 files changed, 11 insertions, 15 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index 423e340c4..89de39145 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -918,22 +918,22 @@ void PopupMenu::handleLink(const std::string &link,
if (being->getType() == ActorType::Npc)
Net::getNpcHandler()->buy(mBeingId);
else if (being->getType() == ActorType::Player)
- Net::getBuySellHandler()->requestSellList(being->getName());
+ buySellHandler->requestSellList(being->getName());
}
else if (link == "buy" && !mNick.empty())
{
- Net::getBuySellHandler()->requestSellList(mNick);
+ buySellHandler->requestSellList(mNick);
}
else if (link == "sell" && being && mBeingId != 0)
{
if (being->getType() == ActorType::Npc)
Net::getNpcHandler()->sell(mBeingId);
else if (being->getType() == ActorType::Player)
- Net::getBuySellHandler()->requestBuyList(being->getName());
+ buySellHandler->requestBuyList(being->getName());
}
else if (link == "sell" && !mNick.empty())
{
- Net::getBuySellHandler()->requestBuyList(mNick);
+ buySellHandler->requestBuyList(mNick);
}
else if (link == "attack" && being)
{
diff --git a/src/gui/windows/buydialog.cpp b/src/gui/windows/buydialog.cpp
index c09044f7b..c86ef184a 100644
--- a/src/gui/windows/buydialog.cpp
+++ b/src/gui/windows/buydialog.cpp
@@ -459,7 +459,7 @@ void BuyDialog::action(const ActionEvent &event)
const ShopItem *const item = mShopItems->at(selectedItem);
if (item)
{
- Net::getBuySellHandler()->sendBuyRequest(mNick,
+ buySellHandler->sendBuyRequest(mNick,
item, mAmountItems);
tradeWindow->addAutoMoney(mNick,
item->getPrice() * mAmountItems);
diff --git a/src/gui/windows/buyselldialog.cpp b/src/gui/windows/buyselldialog.cpp
index 238389ce9..f8d2ec954 100644
--- a/src/gui/windows/buyselldialog.cpp
+++ b/src/gui/windows/buyselldialog.cpp
@@ -132,14 +132,14 @@ void BuySellDialog::action(const ActionEvent &event)
if (mNpcId != -1)
Net::getNpcHandler()->buy(mNpcId);
else
- Net::getBuySellHandler()->requestSellList(mNick);
+ buySellHandler->requestSellList(mNick);
}
else if (eventId == "Sell")
{
if (mNpcId != -1)
Net::getNpcHandler()->sell(mNpcId);
else
- Net::getBuySellHandler()->requestBuyList(mNick);
+ buySellHandler->requestBuyList(mNick);
}
close();
diff --git a/src/gui/windows/selldialog.cpp b/src/gui/windows/selldialog.cpp
index 70d790733..b62b22976 100644
--- a/src/gui/windows/selldialog.cpp
+++ b/src/gui/windows/selldialog.cpp
@@ -305,7 +305,7 @@ void SellDialog::action(const ActionEvent &event)
else
{
ShopItem *const item = mShopItems->at(selectedItem);
- Net::getBuySellHandler()->sendSellRequest(mNick,
+ buySellHandler->sendSellRequest(mNick,
item, mAmountItems);
if (tradeWindow)
diff --git a/src/net/buysellhandler.h b/src/net/buysellhandler.h
index fde6cf835..10eb8a35b 100644
--- a/src/net/buysellhandler.h
+++ b/src/net/buysellhandler.h
@@ -53,4 +53,6 @@ class BuySellHandler notfinal
} // namespace Net
+extern Net::BuySellHandler *buySellHandler;
+
#endif // NET_BUYSELLHANDLER_H
diff --git a/src/net/net.cpp b/src/net/net.cpp
index f6a3413e7..820066570 100644
--- a/src/net/net.cpp
+++ b/src/net/net.cpp
@@ -42,6 +42,7 @@ namespace Net
class AuctionHandler;
class BankHandler;
class BeingHandler;
+ class BuySellHandler;
}
Net::AdminHandler *adminHandler = nullptr;
@@ -132,11 +133,6 @@ Net::TradeHandler *Net::getTradeHandler()
return tradeHandler;
}
-Net::BuySellHandler *Net::getBuySellHandler()
-{
- return buySellHandler;
-}
-
Net::ServerFeatures *Net::getServerFeatures()
{
return serverFeatures;
diff --git a/src/net/net.h b/src/net/net.h
index be6a2647b..baf4c757d 100644
--- a/src/net/net.h
+++ b/src/net/net.h
@@ -52,7 +52,6 @@ class PetHandler;
class PlayerHandler;
class SkillHandler;
class TradeHandler;
-class BuySellHandler;
class ServerFeatures;
CharServerHandler *getCharServerHandler() A_WARN_UNUSED;
@@ -68,7 +67,6 @@ PetHandler *getPetHandler() A_WARN_UNUSED;
PlayerHandler *getPlayerHandler() A_WARN_UNUSED;
SkillHandler *getSkillHandler() A_WARN_UNUSED;
TradeHandler *getTradeHandler() A_WARN_UNUSED;
-BuySellHandler *getBuySellHandler() A_WARN_UNUSED;
ServerFeatures *getServerFeatures() A_WARN_UNUSED;
MailHandler *getMailHandler() A_WARN_UNUSED;
CashShopHandler *getCashShopHandler() A_WARN_UNUSED;