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/shortcutbase.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/shortcutbase.h')
-rw-r--r-- | src/shortcutbase.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/shortcutbase.h b/src/shortcutbase.h index e742b6b18..58520a8ad 100644 --- a/src/shortcutbase.h +++ b/src/shortcutbase.h @@ -23,6 +23,8 @@ #ifndef SHORTCUTBASE_H #define SHORTCUTBASE_H +#include "enums/simpletypes/itemcolor.h" + #include <string> #include "localconsts.h" @@ -67,7 +69,7 @@ class ShortcutBase notfinal 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]; } /** @@ -95,8 +97,9 @@ class ShortcutBase notfinal * @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(); } /** @@ -125,12 +128,12 @@ class ShortcutBase notfinal private: int *mItems A_NONNULLPOINTER; - unsigned char *mItemColors A_NONNULLPOINTER; + ItemColor *mItemColors A_NONNULLPOINTER; std::string mItemName; std::string mColorName; int mItemSelected; int mMaxSize; - unsigned char mItemColorSelected; + ItemColor mItemColorSelected; }; #endif // SHORTCUTBASE_H |