From 41cc92f73e39cec5dfea6b1164176610cccc7df4 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 15 Aug 2015 13:58:32 +0300 Subject: Add strong typed int for item color. --- src/item.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/item.cpp') 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); -- cgit v1.2.3-70-g09d2