diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-08-15 13:58:32 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-08-16 01:52:14 +0300 |
commit | 41cc92f73e39cec5dfea6b1164176610cccc7df4 (patch) | |
tree | 22fd3d388084d2c61fe80f0441c3c30ab8ffd33c /src/itemshortcut.h | |
parent | 7aa637abc8b0bca35aacdb9492e65f557ed32038 (diff) | |
download | ManaVerse-41cc92f73e39cec5dfea6b1164176610cccc7df4.tar.gz ManaVerse-41cc92f73e39cec5dfea6b1164176610cccc7df4.tar.bz2 ManaVerse-41cc92f73e39cec5dfea6b1164176610cccc7df4.tar.xz ManaVerse-41cc92f73e39cec5dfea6b1164176610cccc7df4.zip |
Add strong typed int for item color.
Diffstat (limited to 'src/itemshortcut.h')
-rw-r--r-- | src/itemshortcut.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/itemshortcut.h b/src/itemshortcut.h index 30549f0b8..7dd093abd 100644 --- a/src/itemshortcut.h +++ b/src/itemshortcut.h @@ -23,6 +23,8 @@ #ifndef ITEMSHORTCUT_H #define ITEMSHORTCUT_H +#include "enums/simpletypes/itemcolor.h" + #include "localconsts.h" const unsigned int SHORTCUT_ITEMS = 20; @@ -66,7 +68,7 @@ class ItemShortcut final int getItem(const int index) const A_WARN_UNUSED { return mItems[index]; } - unsigned char getItemColor(const int index) const A_WARN_UNUSED + ItemColor getItemColor(const int index) const A_WARN_UNUSED { return mItemColors[index]; } /** @@ -88,8 +90,9 @@ class ItemShortcut final */ void setItem(const int index); - void setItem(const int index, const int item, - const unsigned char color); + void setItem(const int index, + const int item, + const ItemColor color); /** * Adds an item to the items store specified by the index. @@ -97,8 +100,9 @@ class ItemShortcut final * @param index Index of the item. * @param itemId ID of the item. */ - void setItems(const int index, const int itemId, - const unsigned char color) + void setItems(const int index, + const int itemId, + const ItemColor color) { mItems[index] = itemId; mItemColors[index] = color; save(); } /** @@ -149,10 +153,10 @@ class ItemShortcut final void swap(const int index1, const int index2); private: - int mItems[SHORTCUT_ITEMS]; /**< The items. */ - unsigned char mItemColors[SHORTCUT_ITEMS]; /**< The item colors. */ + int mItems[SHORTCUT_ITEMS]; /**< The items. */ + ItemColor mItemColors[SHORTCUT_ITEMS]; /**< The item colors. */ int mItemSelected; - unsigned char mItemColorSelected; + ItemColor mItemColorSelected; int mNumber; }; |