From 7e3bd20e9675202e30fac741f3d3acb4f19b109d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 9 Apr 2011 19:49:14 +0300 Subject: Small refactoring based on idea from mana commit 30d4b0adf4f17f05d1d62fc3428c896ef1079b6b --- src/net/tmwa/gamehandler.cpp | 10 +++++----- src/net/tmwa/gamehandler.h | 2 +- src/net/tmwa/generalhandler.cpp | 8 ++++---- src/net/tmwa/generalhandler.h | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/net/tmwa') diff --git a/src/net/tmwa/gamehandler.cpp b/src/net/tmwa/gamehandler.cpp index 3e22e94bb..b1f72a834 100644 --- a/src/net/tmwa/gamehandler.cpp +++ b/src/net/tmwa/gamehandler.cpp @@ -62,7 +62,7 @@ GameHandler::GameHandler() gameHandler = this; mCharID = 0; - listen(CHANNEL_GAME); + listen(Mana::CHANNEL_GAME); } void GameHandler::handleMessage(Net::MessageIn &msg) @@ -109,13 +109,13 @@ void GameHandler::handleMessage(Net::MessageIn &msg) } } -void GameHandler::event(Channels channel, const Mana::Event &event) +void GameHandler::event(Mana::Channels channel, const Mana::Event &event) { - if (channel == CHANNEL_GAME) + if (channel == Mana::CHANNEL_GAME) { - if (event.getName() == EVENT_ENGINESINITALIZED) + if (event.getName() == Mana::EVENT_ENGINESINITALIZED) Game::instance()->changeMap(mMap); - else if (event.getName() == EVENT_MAPLOADED) + else if (event.getName() == Mana::EVENT_MAPLOADED) MessageOut outMsg(CMSG_MAP_LOADED); } } diff --git a/src/net/tmwa/gamehandler.h b/src/net/tmwa/gamehandler.h index 7616ae878..fbb623409 100644 --- a/src/net/tmwa/gamehandler.h +++ b/src/net/tmwa/gamehandler.h @@ -49,7 +49,7 @@ class GameHandler : public MessageHandler, public Net::GameHandler, void handleMessage(Net::MessageIn &msg); - void event(Channels channel, const Mana::Event &event); + void event(Mana::Channels channel, const Mana::Event &event); void connect(); diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp index a246d0d8f..26f6983d7 100644 --- a/src/net/tmwa/generalhandler.cpp +++ b/src/net/tmwa/generalhandler.cpp @@ -230,12 +230,12 @@ void GeneralHandler::clearHandlers() mNetwork->clearHandlers(); } -void GeneralHandler::event(Channels channel, +void GeneralHandler::event(Mana::Channels channel, const Mana::Event &event) { - if (channel == CHANNEL_GAME) + if (channel == Mana::CHANNEL_GAME) { - if (event.getName() == EVENT_GUIWINDOWSLOADED) + if (event.getName() == Mana::EVENT_GUIWINDOWSLOADED) { if (inventoryWindow) inventoryWindow->setSplitAllowed(false); @@ -266,7 +266,7 @@ void GeneralHandler::event(Channels channel, statusWindow->addAttribute(ATTACK_RANGE, _("Attack Range"), false, ""); } - else if (event.getName() == EVENT_GUIWINDOWSUNLOADING) + else if (event.getName() == Mana::EVENT_GUIWINDOWSUNLOADING) { if (socialWindow) { diff --git a/src/net/tmwa/generalhandler.h b/src/net/tmwa/generalhandler.h index 6dadb01ed..516db76c5 100644 --- a/src/net/tmwa/generalhandler.h +++ b/src/net/tmwa/generalhandler.h @@ -59,7 +59,7 @@ class GeneralHandler : public MessageHandler, public Net::GeneralHandler, void clearHandlers(); - void event(Channels channel, const Mana::Event &event); + void event(Mana::Channels channel, const Mana::Event &event); protected: MessageHandlerPtr mAdminHandler; -- cgit v1.2.3-70-g09d2