summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-09-28 00:58:25 +0300
committerAndrei Karas <akaras@inbox.ru>2013-09-28 23:40:11 +0300
commit99906c44cf9208dee4e808e03fddd1f209b6b7fc (patch)
tree8472ed92c0963938dee4290d25cd6c4ebf2e4d81 /src/resources
parentc430b75e370a21a17f80d4ba3acd84111828a462 (diff)
downloadplus-99906c44cf9208dee4e808e03fddd1f209b6b7fc.tar.gz
plus-99906c44cf9208dee4e808e03fddd1f209b6b7fc.tar.bz2
plus-99906c44cf9208dee4e808e03fddd1f209b6b7fc.tar.xz
plus-99906c44cf9208dee4e808e03fddd1f209b6b7fc.zip
add const for methods return values.
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/action.cpp2
-rw-r--r--src/resources/action.h2
-rw-r--r--src/resources/iteminfo.cpp3
-rw-r--r--src/resources/iteminfo.h6
4 files changed, 7 insertions, 6 deletions
diff --git a/src/resources/action.cpp b/src/resources/action.cpp
index b4426daae..9b4d4b57a 100644
--- a/src/resources/action.cpp
+++ b/src/resources/action.cpp
@@ -40,7 +40,7 @@ Action::~Action()
delete_all(mAnimations);
}
-Animation *Action::getAnimation(int direction) const
+const Animation *Action::getAnimation(int direction) const
{
Animations::const_iterator i = mAnimations.find(direction);
diff --git a/src/resources/action.h b/src/resources/action.h
index 16f3d96d5..c3b4852b3 100644
--- a/src/resources/action.h
+++ b/src/resources/action.h
@@ -43,7 +43,7 @@ class Action final
void setAnimation(const int direction, Animation *const animation);
- Animation *getAnimation(int direction) const A_WARN_UNUSED;
+ const Animation *getAnimation(int direction) const A_WARN_UNUSED;
unsigned getNumber() const A_WARN_UNUSED
{ return mNumber; }
diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp
index b4d1d5a69..dd86e3196 100644
--- a/src/resources/iteminfo.cpp
+++ b/src/resources/iteminfo.cpp
@@ -236,7 +236,8 @@ const std::string ItemInfo::replaceColors(std::string str,
return replaceAll(str, "%Color%", name);
}
-SpriteToItemMap *ItemInfo::getSpriteToItemReplaceMap(const int direction) const
+const SpriteToItemMap *ItemInfo::getSpriteToItemReplaceMap(const int direction)
+ const
{
if (direction < 0 || direction >= 10)
return nullptr;
diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h
index 292089dc5..71a6119af 100644
--- a/src/resources/iteminfo.h
+++ b/src/resources/iteminfo.h
@@ -238,7 +238,7 @@ class ItemInfo final
void setSpriteOrder(int *const ptr, const int direction,
const int n, const int def = -1) const;
- std::map<int, int> getTags() const A_WARN_UNUSED
+ const std::map<int, int> &getTags() const A_WARN_UNUSED
{ return mTags; }
void addTag(const int tag)
@@ -272,8 +272,8 @@ class ItemInfo final
std::map<int, int> *addReplaceSprite(const int sprite,
const int direction);
- SpriteToItemMap *getSpriteToItemReplaceMap(const int directions)
- const A_WARN_UNUSED;
+ const SpriteToItemMap *getSpriteToItemReplaceMap(const int directions)
+ const A_WARN_UNUSED;
std::string getDyeColorsString(const int color) const A_WARN_UNUSED;