summaryrefslogtreecommitdiff
path: root/src/net/ea
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-10-17 23:03:03 +0300
committerAndrei Karas <akaras@inbox.ru>2014-10-17 23:03:03 +0300
commit84b67aacfdedd8d526d246e3d3c0914a899d491c (patch)
treeee24b23538b0e68cf8addb5240fbdc2182247006 /src/net/ea
parent0567d32aa605e66563abdb34d998cce18cea3cc2 (diff)
downloadmv-84b67aacfdedd8d526d246e3d3c0914a899d491c.tar.gz
mv-84b67aacfdedd8d526d246e3d3c0914a899d491c.tar.bz2
mv-84b67aacfdedd8d526d246e3d3c0914a899d491c.tar.xz
mv-84b67aacfdedd8d526d246e3d3c0914a899d491c.zip
Add static in npchandler.
Diffstat (limited to 'src/net/ea')
-rw-r--r--src/net/ea/npchandler.cpp23
-rw-r--r--src/net/ea/npchandler.h18
2 files changed, 21 insertions, 20 deletions
diff --git a/src/net/ea/npchandler.cpp b/src/net/ea/npchandler.cpp
index fedc7c744..9a1592576 100644
--- a/src/net/ea/npchandler.cpp
+++ b/src/net/ea/npchandler.cpp
@@ -33,10 +33,13 @@
namespace Ea
{
-NpcHandler::NpcHandler() :
- mDialog(nullptr),
- mRequestLang(false)
+NpcDialog *NpcHandler::mDialog = nullptr;
+bool NpcHandler::mRequestLang = false;
+
+NpcHandler::NpcHandler()
{
+ mDialog = nullptr;
+ mRequestLang = false;
}
void NpcHandler::sendLetter(const int npcId A_UNUSED,
@@ -55,7 +58,7 @@ void NpcHandler::endShopping(const int beingId A_UNUSED) const
void NpcHandler::processNpcChoice(Net::MessageIn &msg)
{
- getNpc(msg);
+ npcHandler->getNpc(msg);
mRequestLang = false;
if (mDialog)
@@ -71,7 +74,7 @@ void NpcHandler::processNpcChoice(Net::MessageIn &msg)
void NpcHandler::processNpcMessage(Net::MessageIn &msg)
{
- getNpc(msg);
+ npcHandler->getNpc(msg);
mRequestLang = false;
const std::string message = msg.readString(msg.getLength() - 8);
@@ -85,7 +88,7 @@ void NpcHandler::processNpcMessage(Net::MessageIn &msg)
void NpcHandler::processNpcClose(Net::MessageIn &msg)
{
// Show the close button
- getNpc(msg);
+ npcHandler->getNpc(msg);
mRequestLang = false;
if (mDialog)
mDialog->showCloseButton();
@@ -94,7 +97,7 @@ void NpcHandler::processNpcClose(Net::MessageIn &msg)
void NpcHandler::processNpcNext(Net::MessageIn &msg)
{
// Show the next button
- getNpc(msg);
+ npcHandler->getNpc(msg);
mRequestLang = false;
if (mDialog)
mDialog->showNextButton();
@@ -103,7 +106,7 @@ void NpcHandler::processNpcNext(Net::MessageIn &msg)
void NpcHandler::processNpcIntInput(Net::MessageIn &msg)
{
// Request for an integer
- getNpc(msg);
+ npcHandler->getNpc(msg);
mRequestLang = false;
if (mDialog)
mDialog->integerRequest(0);
@@ -112,11 +115,11 @@ void NpcHandler::processNpcIntInput(Net::MessageIn &msg)
void NpcHandler::processNpcStrInput(Net::MessageIn &msg)
{
// Request for a string
- int npcId = getNpc(msg);
+ int npcId = npcHandler->getNpc(msg);
if (mRequestLang)
{
mRequestLang = false;
- stringInput(npcId, getLangSimple());
+ npcHandler->stringInput(npcId, getLangSimple());
}
else if (mDialog)
{
diff --git a/src/net/ea/npchandler.h b/src/net/ea/npchandler.h
index 81e92d84a..901ee9148 100644
--- a/src/net/ea/npchandler.h
+++ b/src/net/ea/npchandler.h
@@ -49,26 +49,24 @@ class NpcHandler notfinal : public Net::NpcHandler
void endShopping(const int beingId) const override final;
- virtual int getNpc(Net::MessageIn &msg) = 0;
+ static void processNpcChoice(Net::MessageIn &msg);
- void processNpcChoice(Net::MessageIn &msg);
+ static void processNpcMessage(Net::MessageIn &msg);
- void processNpcMessage(Net::MessageIn &msg);
+ static void processNpcClose(Net::MessageIn &msg);
- void processNpcClose(Net::MessageIn &msg);
+ static void processNpcNext(Net::MessageIn &msg);
- void processNpcNext(Net::MessageIn &msg);
+ static void processNpcIntInput(Net::MessageIn &msg);
- void processNpcIntInput(Net::MessageIn &msg);
-
- void processNpcStrInput(Net::MessageIn &msg);
+ static void processNpcStrInput(Net::MessageIn &msg);
protected:
NpcHandler();
- NpcDialog *mDialog;
+ static NpcDialog *mDialog;
- bool mRequestLang;
+ static bool mRequestLang;
};
} // namespace Ea