From f2dba51be00b6c67b6d1b8924cac8019a3bcd000 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 27 May 2015 21:39:10 +0300 Subject: Add strong typed bool type Move. --- src/being/being.cpp | 9 +++++---- src/being/being.h | 4 +++- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'src/being') diff --git a/src/being/being.cpp b/src/being/being.cpp index 9c820f0c5..a4ffbbf3f 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -117,7 +117,7 @@ bool Being::mShowLevel = false; bool Being::mShowPlayersStatus = false; bool Being::mEnableReorderSprites = true; bool Being::mHideErased = false; -bool Being::mMoveNames = false; +Move Being::mMoveNames = Move_false; bool Being::mUseDiagonal = true; int Being::mAwayEffect = -1; @@ -457,8 +457,9 @@ void Being::setPosition(const Vector &pos) if (mText) { - mText->adviseXY(static_cast(pos.x), static_cast(pos.y) - - getHeight() - mText->getHeight() - 6, mMoveNames); + mText->adviseXY(static_cast(pos.x), + static_cast(pos.y) - getHeight() - mText->getHeight() - 6, + mMoveNames); } } @@ -2333,7 +2334,7 @@ void Being::reReadConfig() mShowPlayersStatus = config.getBoolValue("showPlayersStatus"); mEnableReorderSprites = config.getBoolValue("enableReorderSprites"); mHideErased = config.getBoolValue("hideErased"); - mMoveNames = config.getBoolValue("moveNames"); + mMoveNames = fromBool(config.getBoolValue("moveNames"), Move); mUseDiagonal = config.getBoolValue("useDiagonalSpeed"); mUpdateConfigTime = cur_time; diff --git a/src/being/being.h b/src/being/being.h index 6fb26b620..03a69b986 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -23,6 +23,8 @@ #ifndef BEING_BEING_H #define BEING_BEING_H +#include "enums/simpletypes/move.h" + #include "resources/beinginfo.h" #include "position.h" @@ -1079,7 +1081,7 @@ class Being notfinal : public ActorSprite, static bool mShowPlayersStatus; static bool mEnableReorderSprites; static bool mHideErased; - static bool mMoveNames; + static Move mMoveNames; static bool mUseDiagonal; static int mAwayEffect; -- cgit v1.2.3-60-g2f50