diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-08-30 22:53:27 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-08-30 22:53:27 +0300 |
commit | 5cbd0d2cb7086fda592c00dbc3b07d06af95f080 (patch) | |
tree | d36b4ac344f31f34311c7cb7a9a637ed48356e3e /src/gui/widgets/shopitems.h | |
parent | 4210163dae7d6266923ab11f78b631173c9533e3 (diff) | |
download | plus-5cbd0d2cb7086fda592c00dbc3b07d06af95f080.tar.gz plus-5cbd0d2cb7086fda592c00dbc3b07d06af95f080.tar.bz2 plus-5cbd0d2cb7086fda592c00dbc3b07d06af95f080.tar.xz plus-5cbd0d2cb7086fda592c00dbc3b07d06af95f080.zip |
Add const to more classes.
Diffstat (limited to 'src/gui/widgets/shopitems.h')
-rw-r--r-- | src/gui/widgets/shopitems.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/gui/widgets/shopitems.h b/src/gui/widgets/shopitems.h index c013f1810..ff1b0ca7a 100644 --- a/src/gui/widgets/shopitems.h +++ b/src/gui/widgets/shopitems.h @@ -48,14 +48,15 @@ class ShopItems : public gcn::ListModel * @param mergeDuplicates lets the Shop look for duplicate entries and * merges them to one item. */ - ShopItems(bool mergeDuplicates = false); + ShopItems(const bool mergeDuplicates = false); ~ShopItems(); /** * Adds an item to the list. */ - void addItem(int id, unsigned char color, int amount, int price); + void addItem(const int id, const unsigned char color, + const int amount, const int price); /** * Adds an item to the list (used by sell dialog). Looks for @@ -66,17 +67,19 @@ class ShopItems : public gcn::ListModel * @param quantity number of available copies of the item * @param price price of the item */ - void addItem2(int inventoryIndex, int id, unsigned char color, - int amount, int price); + void addItem2(const int inventoryIndex, const int id, + const unsigned char color, + const int amount, const int price); - void addItemNoDup(int id, unsigned char color, int amount, int price); + void addItemNoDup(const int id, const unsigned char color, + const int amount, const int price); /** * Returns the number of items in the shop. */ int getNumberOfElements(); - bool empty(); + bool empty() const; /** * Returns the name of item number i in the shop. @@ -95,14 +98,14 @@ class ShopItems : public gcn::ListModel * * @param i index to remove */ - void erase(unsigned int i); + void erase(const unsigned int i); /** * Removes an element from the shop and destroy it. * * @param i index to remove */ - void del(unsigned int i); + void del(const unsigned int i); /** * Clears the list of items in the shop. @@ -119,7 +122,7 @@ class ShopItems : public gcn::ListModel * * @return the item found or 0 */ - ShopItem *findItem(int id, unsigned char color) const; + ShopItem *findItem(const int id, const unsigned char color) const; /** The list of items in the shop. */ std::vector<ShopItem*> mShopItems; |