summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-03 14:31:43 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-03 14:31:43 +0300
commitb643a5c48d53dbeca7672e3c8b5182f9d698abcb (patch)
treeab596dc9a0c573764c1e0b427f22303faa1bfec1 /src/net/tmwa
parent6281c1281fe85a1c75155df44c99aa843561a4f2 (diff)
downloadmanaplus-b643a5c48d53dbeca7672e3c8b5182f9d698abcb.tar.gz
manaplus-b643a5c48d53dbeca7672e3c8b5182f9d698abcb.tar.bz2
manaplus-b643a5c48d53dbeca7672e3c8b5182f9d698abcb.tar.xz
manaplus-b643a5c48d53dbeca7672e3c8b5182f9d698abcb.zip
Convert PacketShare enum into strong typed enum.
Diffstat (limited to 'src/net/tmwa')
-rw-r--r--src/net/tmwa/partyhandler.cpp14
-rw-r--r--src/net/tmwa/partyhandler.h6
2 files changed, 10 insertions, 10 deletions
diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp
index 8bb143d75..f503b666c 100644
--- a/src/net/tmwa/partyhandler.cpp
+++ b/src/net/tmwa/partyhandler.cpp
@@ -183,9 +183,9 @@ void PartyHandler::chat(const std::string &text) const
outMsg.writeString(text, static_cast<int>(text.length()), "text");
}
-void PartyHandler::setShareExperience(const Net::PartyShare::Type share) const
+void PartyHandler::setShareExperience(const PartyShareT share) const
{
- if (share == Net::PartyShare::NOT_POSSIBLE)
+ if (share == PartyShare::NOT_POSSIBLE)
return;
createOutPacket(CMSG_PARTY_SETTINGS);
@@ -193,9 +193,9 @@ void PartyHandler::setShareExperience(const Net::PartyShare::Type share) const
outMsg.writeInt16(static_cast<int16_t>(mShareItems), "share items");
}
-void PartyHandler::setShareItems(const Net::PartyShare::Type share) const
+void PartyHandler::setShareItems(const PartyShareT share) const
{
- if (share == Net::PartyShare::NOT_POSSIBLE)
+ if (share == PartyShare::NOT_POSSIBLE)
return;
createOutPacket(CMSG_PARTY_SETTINGS);
@@ -214,8 +214,10 @@ void PartyHandler::processPartySettings(Net::MessageIn &msg)
}
// These seem to indicate the sharing mode for exp and items
- const int16_t exp = msg.readInt16("share exp");
- const int16_t item = msg.readInt16("share items");
+ const PartyShareT exp = static_cast<PartyShareT>(
+ msg.readInt16("share exp"));
+ const PartyShareT item = static_cast<PartyShareT>(
+ msg.readInt16("share items"));
processPartySettingsContinue(msg, exp, item);
}
diff --git a/src/net/tmwa/partyhandler.h b/src/net/tmwa/partyhandler.h
index 3768964a5..af18e2d14 100644
--- a/src/net/tmwa/partyhandler.h
+++ b/src/net/tmwa/partyhandler.h
@@ -56,11 +56,9 @@ class PartyHandler final : public MessageHandler, public Ea::PartyHandler
void chat(const std::string &text) const override final;
- void setShareExperience(const Net::PartyShare::Type share)
- const override final;
+ void setShareExperience(const PartyShareT share) const override final;
- void setShareItems(const Net::PartyShare::Type
- share) const override final;
+ void setShareItems(const PartyShareT share) const override final;
void changeLeader(const std::string &name) const override final;