diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-19 15:21:11 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-19 15:21:11 +0300 |
commit | ad3ee95f90bfd368a511407c13718b900e44be0f (patch) | |
tree | f3f41b9802d684d784b7cef05e0d6ae2383b5e5b /src/resources/action.cpp | |
parent | fba4289e53447a09dcf82211e2dab3563e2581f1 (diff) | |
download | plus-ad3ee95f90bfd368a511407c13718b900e44be0f.tar.gz plus-ad3ee95f90bfd368a511407c13718b900e44be0f.tar.bz2 plus-ad3ee95f90bfd368a511407c13718b900e44be0f.tar.xz plus-ad3ee95f90bfd368a511407c13718b900e44be0f.zip |
Move spritedirection into separate file.
Diffstat (limited to 'src/resources/action.cpp')
-rw-r--r-- | src/resources/action.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/resources/action.cpp b/src/resources/action.cpp index cbcf4f72b..8576ffab8 100644 --- a/src/resources/action.cpp +++ b/src/resources/action.cpp @@ -39,20 +39,21 @@ Action::~Action() delete_all(mAnimations); } -const Animation *Action::getAnimation(SpriteDirection direction) const noexcept +const Animation *Action::getAnimation(SpriteDirection::Type direction) + const noexcept { Animations::const_iterator i = mAnimations.find(direction); if (i == mAnimations.end()) { - if (direction == DIRECTION_UPLEFT || direction == DIRECTION_UPRIGHT) + if (direction == SpriteDirection::UPLEFT || direction == SpriteDirection::UPRIGHT) { - direction = DIRECTION_UP; + direction = SpriteDirection::UP; } - else if (direction == DIRECTION_DOWNLEFT - || direction == DIRECTION_DOWNRIGHT) + else if (direction == SpriteDirection::DOWNLEFT + || direction == SpriteDirection::DOWNRIGHT) { - direction = DIRECTION_DOWN; + direction = SpriteDirection::DOWN; } i = mAnimations.find(direction); @@ -65,7 +66,7 @@ const Animation *Action::getAnimation(SpriteDirection direction) const noexcept return (i == mAnimations.end()) ? nullptr : i->second; } -void Action::setAnimation(const SpriteDirection direction, +void Action::setAnimation(const SpriteDirection::Type direction, Animation *const animation) noexcept { mAnimations[direction] = animation; |