summaryrefslogtreecommitdiff
path: root/src/item.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-08-15 13:58:32 +0300
committerAndrei Karas <akaras@inbox.ru>2015-08-16 01:52:14 +0300
commit41cc92f73e39cec5dfea6b1164176610cccc7df4 (patch)
tree22fd3d388084d2c61fe80f0441c3c30ab8ffd33c /src/item.cpp
parent7aa637abc8b0bca35aacdb9492e65f557ed32038 (diff)
downloadmanaplus-41cc92f73e39cec5dfea6b1164176610cccc7df4.tar.gz
manaplus-41cc92f73e39cec5dfea6b1164176610cccc7df4.tar.bz2
manaplus-41cc92f73e39cec5dfea6b1164176610cccc7df4.tar.xz
manaplus-41cc92f73e39cec5dfea6b1164176610cccc7df4.zip
Add strong typed int for item color.
Diffstat (limited to 'src/item.cpp')
-rw-r--r--src/item.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/item.cpp b/src/item.cpp
index 7fa816c86..0ccfd025a 100644
--- a/src/item.cpp
+++ b/src/item.cpp
@@ -40,14 +40,14 @@ Item::Item(const int id,
const int type,
const int quantity,
const uint8_t refine,
- const unsigned char color,
+ const ItemColor color,
const Identified identified,
const Damaged damaged,
const Favorite favorite,
const Equipm equipment,
const Equipped equipped) :
mId(0),
- mColor(0),
+ mColor(ItemColor_zero),
mQuantity(quantity),
mImage(nullptr),
mDescription(),
@@ -78,7 +78,8 @@ Item::~Item()
dragDrop.clearItem(this);
}
-void Item::setId(const int id, const unsigned char color)
+void Item::setId(const int id,
+ const ItemColor color)
{
mId = id;
mColor = color;
@@ -114,7 +115,8 @@ bool Item::isHaveTag(const int tagId) const
return (*it).second > 0;
}
-Image *Item::getImage(const int id, const unsigned char color)
+Image *Item::getImage(const int id,
+ const ItemColor color)
{
ResourceManager *const resman = ResourceManager::getInstance();
const ItemInfo &info = ItemDB::get(id);