summaryrefslogtreecommitdiff
path: root/src/item.h
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.h
parent7aa637abc8b0bca35aacdb9492e65f557ed32038 (diff)
downloadmv-41cc92f73e39cec5dfea6b1164176610cccc7df4.tar.gz
mv-41cc92f73e39cec5dfea6b1164176610cccc7df4.tar.bz2
mv-41cc92f73e39cec5dfea6b1164176610cccc7df4.tar.xz
mv-41cc92f73e39cec5dfea6b1164176610cccc7df4.zip
Add strong typed int for item color.
Diffstat (limited to 'src/item.h')
-rw-r--r--src/item.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/item.h b/src/item.h
index 815160c32..c3b22a9dc 100644
--- a/src/item.h
+++ b/src/item.h
@@ -28,6 +28,7 @@
#include "enums/simpletypes/equipped.h"
#include "enums/simpletypes/favorite.h"
#include "enums/simpletypes/identified.h"
+#include "enums/simpletypes/itemcolor.h"
#include "resources/db/itemdb.h"
@@ -50,7 +51,7 @@ class Item notfinal
const int type,
const int quantity,
const uint8_t refine,
- const uint8_t color,
+ const ItemColor color,
const Identified identified,
const Damaged damaged,
const Favorite favorite,
@@ -67,7 +68,7 @@ class Item notfinal
/**
* Sets the item id, color the item type.
*/
- void setId(const int id, const unsigned char color);
+ void setId(const int id, const ItemColor color);
/**
* Returns the item id.
@@ -168,11 +169,11 @@ class Item notfinal
std::string getName() const A_WARN_UNUSED;
static Image *getImage(const int id,
- const unsigned char color) A_WARN_UNUSED;
+ const ItemColor color) A_WARN_UNUSED;
bool isHaveTag(const int tagId) const A_WARN_UNUSED;
- unsigned char getColor() const A_WARN_UNUSED
+ ItemColor getColor() const A_WARN_UNUSED
{ return mColor; }
const std::string &getDescription() const A_WARN_UNUSED
@@ -214,7 +215,7 @@ class Item notfinal
void addCard(const int card);
int mId; /**< Item type id. */
- unsigned char mColor;
+ ItemColor mColor;
int mQuantity; /**< Number of items. */
protected: