summaryrefslogtreecommitdiff
path: root/src/itemshortcut.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/itemshortcut.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/itemshortcut.h')
-rw-r--r--src/itemshortcut.h20
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;
};