From 814e88e5ca69bc54837be27429dbf42dd41f7ac6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 12 May 2014 19:12:15 +0300 Subject: Move being action into separate file. --- src/net/tmwa/beinghandler.cpp | 16 ++++++++-------- src/net/tmwa/playerhandler.cpp | 16 ++++++++-------- src/net/tmwa/playerhandler.h | 3 ++- 3 files changed, 18 insertions(+), 17 deletions(-) (limited to 'src/net/tmwa') diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp index cd3a2cc15..314f9ee49 100644 --- a/src/net/tmwa/beinghandler.cpp +++ b/src/net/tmwa/beinghandler.cpp @@ -567,8 +567,8 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg, dstBeing->setDirectionDelayed(static_cast(d)); } - if (player_node->getCurrentAction() != Being::STAND) - player_node->imitateAction(dstBeing, Being::STAND); + if (player_node->getCurrentAction() != BeingAction::STAND) + player_node->imitateAction(dstBeing, BeingAction::STAND); if (player_node->getDirection() != dstBeing->getDirection()) { player_node->imitateDirection(dstBeing, @@ -597,21 +597,21 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg, switch (type) { case 0: - dstBeing->setAction(Being::STAND, 0); - player_node->imitateAction(dstBeing, Being::STAND); + dstBeing->setAction(BeingAction::STAND, 0); + player_node->imitateAction(dstBeing, BeingAction::STAND); break; case 1: - if (dstBeing->getCurrentAction() != Being::DEAD) + if (dstBeing->getCurrentAction() != BeingAction::DEAD) { - dstBeing->setAction(Being::DEAD, 0); + dstBeing->setAction(BeingAction::DEAD, 0); dstBeing->recalcSpritesOrder(); } break; case 2: - dstBeing->setAction(Being::SIT, 0); - player_node->imitateAction(dstBeing, Being::SIT); + dstBeing->setAction(BeingAction::SIT, 0); + player_node->imitateAction(dstBeing, BeingAction::SIT); break; default: diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp index f9a8580df..550d0e89d 100644 --- a/src/net/tmwa/playerhandler.cpp +++ b/src/net/tmwa/playerhandler.cpp @@ -201,23 +201,23 @@ void PlayerHandler::setDestination(const int x, const int y, static_cast(direction)); } -void PlayerHandler::changeAction(const Being::Action &action) const +void PlayerHandler::changeAction(const BeingAction::Action &action) const { char type; switch (action) { - case Being::SIT: + case BeingAction::SIT: type = 2; break; - case Being::STAND: + case BeingAction::STAND: type = 3; break; default: - case Being::MOVE: - case Being::ATTACK: - case Being::DEAD: - case Being::HURT: - case Being::SPAWN: + case BeingAction::MOVE: + case BeingAction::ATTACK: + case BeingAction::DEAD: + case BeingAction::HURT: + case BeingAction::SPAWN: return; } diff --git a/src/net/tmwa/playerhandler.h b/src/net/tmwa/playerhandler.h index 125eea0ba..83dacf0ae 100644 --- a/src/net/tmwa/playerhandler.h +++ b/src/net/tmwa/playerhandler.h @@ -50,7 +50,8 @@ class PlayerHandler final : public MessageHandler, public Ea::PlayerHandler void setDirection(const unsigned char direction) const override final; void setDestination(const int x, const int y, const int direction) const override final; - void changeAction(const Being::Action &action) const override final; + void changeAction(const BeingAction::Action &action) + const override final; static void processOnlineList(Net::MessageIn &msg); void requestOnlineList() const override final; void updateStatus(const uint8_t status) const override final; -- cgit v1.2.3-70-g09d2