diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-05 20:58:21 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-05 20:58:21 +0300 |
commit | a87db81b6b7551a248e31e2850577aefda092538 (patch) | |
tree | f47c20512183113face758cf58ec71369c82806c /src/net/tmwa | |
parent | 92c019dad798f1a84c5d3e8e8331a885f6458133 (diff) | |
download | plus-a87db81b6b7551a248e31e2850577aefda092538.tar.gz plus-a87db81b6b7551a248e31e2850577aefda092538.tar.bz2 plus-a87db81b6b7551a248e31e2850577aefda092538.tar.xz plus-a87db81b6b7551a248e31e2850577aefda092538.zip |
Replace most bools usage in playerinfo to strong typed bools.
Diffstat (limited to 'src/net/tmwa')
-rw-r--r-- | src/net/tmwa/homunculushandler.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/homunculushandler.h | 2 | ||||
-rw-r--r-- | src/net/tmwa/mercenaryhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/mercenaryhandler.h | 2 | ||||
-rw-r--r-- | src/net/tmwa/playerhandler.cpp | 20 | ||||
-rw-r--r-- | src/net/tmwa/playerhandler.h | 4 | ||||
-rw-r--r-- | src/net/tmwa/tradehandler.cpp | 2 |
7 files changed, 19 insertions, 15 deletions
diff --git a/src/net/tmwa/homunculushandler.cpp b/src/net/tmwa/homunculushandler.cpp index b851aef20..8ffbb6ed4 100644 --- a/src/net/tmwa/homunculushandler.cpp +++ b/src/net/tmwa/homunculushandler.cpp @@ -55,7 +55,7 @@ void HomunculusHandler::move(const int x A_UNUSED, const int y A_UNUSED) const } void HomunculusHandler::attack(const int targetId A_UNUSED, - const bool keep A_UNUSED) const + const Keep keep A_UNUSED) const { } diff --git a/src/net/tmwa/homunculushandler.h b/src/net/tmwa/homunculushandler.h index 5b4272161..9aec1eed6 100644 --- a/src/net/tmwa/homunculushandler.h +++ b/src/net/tmwa/homunculushandler.h @@ -46,7 +46,7 @@ class HomunculusHandler final : public MessageHandler, void move(const int x, const int y) const override final; - void attack(const int targetId, const bool keep) const override final; + void attack(const int targetId, const Keep keep) const override final; void feed() const override final; diff --git a/src/net/tmwa/mercenaryhandler.cpp b/src/net/tmwa/mercenaryhandler.cpp index 2dc3e388f..aa71c7f69 100644 --- a/src/net/tmwa/mercenaryhandler.cpp +++ b/src/net/tmwa/mercenaryhandler.cpp @@ -59,7 +59,7 @@ void MercenaryHandler::move(const int x A_UNUSED, const int y A_UNUSED) const } void MercenaryHandler::attack(const int targetId A_UNUSED, - const bool keep A_UNUSED) const + const Keep keep A_UNUSED) const { } diff --git a/src/net/tmwa/mercenaryhandler.h b/src/net/tmwa/mercenaryhandler.h index 1d5a40b8a..f2fe3ecae 100644 --- a/src/net/tmwa/mercenaryhandler.h +++ b/src/net/tmwa/mercenaryhandler.h @@ -48,7 +48,7 @@ class MercenaryHandler final : public MessageHandler, void move(const int x, const int y) const override final; - void attack(const int targetId, const bool keep) const override final; + void attack(const int targetId, const Keep keep) const override final; void talk(const std::string &restrict text) const override final; diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp index cc11aa8ba..c78382f27 100644 --- a/src/net/tmwa/playerhandler.cpp +++ b/src/net/tmwa/playerhandler.cpp @@ -124,11 +124,11 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg) BLOCK_END("PlayerHandler::handleMessage") } -void PlayerHandler::attack(const int id, const bool keep) const +void PlayerHandler::attack(const int id, const Keep keep) const { createOutPacket(CMSG_PLAYER_CHANGE_ACT); outMsg.writeInt32(id, "target id"); - if (keep) + if (keep == Keep_true) outMsg.writeInt8(7, "action"); else outMsg.writeInt8(0, "action"); @@ -327,25 +327,29 @@ void PlayerHandler::processPlayerStatUpdate5(Net::MessageIn &msg) msg.readUInt8("luk cost"); } - PlayerInfo::setStatBase(Attributes::ATK, msg.readInt16("atk"), false); + PlayerInfo::setStatBase(Attributes::ATK, + msg.readInt16("atk"), Notify_false); PlayerInfo::setStatMod(Attributes::ATK, msg.readInt16("atk+")); PlayerInfo::updateAttrs(); val = msg.readInt16("matk"); - PlayerInfo::setStatBase(Attributes::MATK, val, false); + PlayerInfo::setStatBase(Attributes::MATK, val, Notify_false); val = msg.readInt16("matk+"); PlayerInfo::setStatMod(Attributes::MATK, val); - PlayerInfo::setStatBase(Attributes::DEF, msg.readInt16("def"), false); + PlayerInfo::setStatBase(Attributes::DEF, + msg.readInt16("def"), Notify_false); PlayerInfo::setStatMod(Attributes::DEF, msg.readInt16("def+")); - PlayerInfo::setStatBase(Attributes::MDEF, msg.readInt16("mdef"), false); + PlayerInfo::setStatBase(Attributes::MDEF, + msg.readInt16("mdef"), Notify_false); PlayerInfo::setStatMod(Attributes::MDEF, msg.readInt16("mdef+")); PlayerInfo::setStatBase(Attributes::HIT, msg.readInt16("hit")); - PlayerInfo::setStatBase(Attributes::FLEE, msg.readInt16("flee"), false); + PlayerInfo::setStatBase(Attributes::FLEE, + msg.readInt16("flee"), Notify_false); PlayerInfo::setStatMod(Attributes::FLEE, msg.readInt16("flee+")); PlayerInfo::setStatBase(Attributes::CRIT, msg.readInt16("crit")); @@ -403,7 +407,7 @@ void PlayerHandler::setStat(Net::MessageIn &msg, const int type, const int base, const int mod, - const bool notify) const + const Notify notify) const { if (type == 500) { diff --git a/src/net/tmwa/playerhandler.h b/src/net/tmwa/playerhandler.h index 062e00db6..f0162c8f2 100644 --- a/src/net/tmwa/playerhandler.h +++ b/src/net/tmwa/playerhandler.h @@ -39,7 +39,7 @@ class PlayerHandler final : public MessageHandler, public Ea::PlayerHandler void handleMessage(Net::MessageIn &msg) override final; - void attack(const int id, const bool keep) const override final; + void attack(const int id, const Keep keep) const override final; void stopAttack() const override final; void emote(const uint8_t emoteId) const override final; @@ -83,7 +83,7 @@ class PlayerHandler final : public MessageHandler, public Ea::PlayerHandler const int type, const int base, const int mod, - const bool notify) const override final; + const Notify notify) const override final; static void processPlayerStatUpdate5(Net::MessageIn &msg); diff --git a/src/net/tmwa/tradehandler.cpp b/src/net/tmwa/tradehandler.cpp index f734a2e43..5962ff89a 100644 --- a/src/net/tmwa/tradehandler.cpp +++ b/src/net/tmwa/tradehandler.cpp @@ -124,7 +124,7 @@ void TradeHandler::request(const Being *const being) const void TradeHandler::respond(const bool accept) const { if (!accept) - PlayerInfo::setTrading(false); + PlayerInfo::setTrading(Trading_false); createOutPacket(CMSG_TRADE_RESPONSE); outMsg.writeInt8(static_cast<int8_t>(accept ? 3 : 4), "accept"); |