summaryrefslogtreecommitdiff
path: root/src/itemshortcut.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-08-31 23:42:43 +0300
committerAndrei Karas <akaras@inbox.ru>2012-09-01 18:47:54 +0300
commited3410d7eb61593a2235ddba97ce257c85e405a6 (patch)
tree565c93ff291f70749cda2f59a4cc6fcd015ff203 /src/itemshortcut.h
parent386dac2875f4a5ad4a534c403338db3b26239a68 (diff)
downloadmv-ed3410d7eb61593a2235ddba97ce257c85e405a6.tar.gz
mv-ed3410d7eb61593a2235ddba97ce257c85e405a6.tar.bz2
mv-ed3410d7eb61593a2235ddba97ce257c85e405a6.tar.xz
mv-ed3410d7eb61593a2235ddba97ce257c85e405a6.zip
Add const to more classes.
Diffstat (limited to 'src/itemshortcut.h')
-rw-r--r--src/itemshortcut.h27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/itemshortcut.h b/src/itemshortcut.h
index 8711b9c03..6ef5d996a 100644
--- a/src/itemshortcut.h
+++ b/src/itemshortcut.h
@@ -37,7 +37,7 @@ class ItemShortcut
/**
* Constructor.
*/
- ItemShortcut(int number);
+ ItemShortcut(const int number);
/**
* Destructor.
@@ -47,22 +47,22 @@ class ItemShortcut
/**
* Load the configuration information.
*/
- void load(bool oldConfig = 0);
+ void load(const bool oldConfig = false);
/**
* Save the configuration information.
*/
- void save();
+ void save() const;
/**
* Returns the shortcut item ID specified by the index.
*
* @param index Index of the shortcut item.
*/
- int getItem(int index) const
+ int getItem(const int index) const
{ return mItems[index]; }
- unsigned char getItemColor(int index) const
+ unsigned char getItemColor(const int index) const
{ return mItemColors[index]; }
/**
@@ -82,7 +82,7 @@ class ItemShortcut
*
* @param index Index of the items.
*/
- void setItem(int index);
+ void setItem(const int index);
/**
* Adds an item to the items store specified by the index.
@@ -90,7 +90,8 @@ class ItemShortcut
* @param index Index of the item.
* @param itemId ID of the item.
*/
- void setItems(int index, int itemId, unsigned char color)
+ void setItems(const int index, const int itemId,
+ const unsigned char color)
{ mItems[index] = itemId; mItemColors[index] = color; save(); }
/**
@@ -98,10 +99,10 @@ class ItemShortcut
*
* @param itemId The ID of the item that is to be assigned.
*/
- void setItemSelected(int itemId)
+ void setItemSelected(const int itemId)
{ mItemSelected = itemId; }
- void setItemSelected(Item *item);
+ void setItemSelected(const Item *const item);
/**
* Returns selected shortcut item ID.
@@ -118,7 +119,7 @@ class ItemShortcut
/**
* Remove a item from the shortcut.
*/
- void removeItem(int index)
+ void removeItem(const int index)
{ mItems[index] = -1; save(); }
/**
@@ -126,17 +127,17 @@ class ItemShortcut
*
* @param index Index of the item shortcut.
*/
- void useItem(int index);
+ void useItem(const int index) const;
/**
* Equip a item from the shortcut.
*/
- void equipItem(int index);
+ void equipItem(const int index) const;
/**
* UnEquip a item from the shortcut.
*/
- void unequipItem(int index);
+ void unequipItem(const int index) const;
private: