diff options
author | Matthew Cline <zelgadis@sourceforge.net> | 2009-11-27 19:18:08 -0800 |
---|---|---|
committer | Matthew Cline <zelgadis@sourceforge.net> | 2009-11-27 19:49:05 -0800 |
commit | 07709472a29e1dca1b12e0feb51b5e596b6b2002 (patch) | |
tree | 2667172216681db0ff58e9160e22b3aabef7033c | |
parent | 6d16cbb7c1a0c2d9895bc02beebbf1dee3236dc0 (diff) | |
download | crawl-ref-07709472a29e1dca1b12e0feb51b5e596b6b2002.tar.gz crawl-ref-07709472a29e1dca1b12e0feb51b5e596b6b2002.zip |
ShoppingList: pass level_pos* as const
-rw-r--r-- | crawl-ref/source/shopping.cc | 15 | ||||
-rw-r--r-- | crawl-ref/source/shopping.h | 13 |
2 files changed, 16 insertions, 12 deletions
diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc index 4c6f007595..d3b6a1ee95 100644 --- a/crawl-ref/source/shopping.cc +++ b/crawl-ref/source/shopping.cc @@ -2123,7 +2123,7 @@ ShoppingList::ShoppingList() (*thing)[SHOPPING_THING_POS_KEY] = pos; bool ShoppingList::add_thing(const item_def &item, int cost, - level_pos* _pos) + const level_pos* _pos) { ASSERT(item.is_valid()); ASSERT(cost > 0); @@ -2153,7 +2153,7 @@ bool ShoppingList::add_thing(const item_def &item, int cost, } bool ShoppingList::add_thing(std::string desc, std::string buy_verb, int cost, - level_pos* _pos) + const level_pos* _pos) { ASSERT(!desc.empty()); ASSERT(!buy_verb.empty()); @@ -2186,21 +2186,24 @@ bool ShoppingList::add_thing(std::string desc, std::string buy_verb, int cost, #undef SETUP_THING -bool ShoppingList::is_on_list(const item_def &item, level_pos* _pos) const +bool ShoppingList::is_on_list(const item_def &item, + const level_pos* _pos) const { SETUP_POS(); return (find_thing(item, pos) != -1); } -bool ShoppingList::is_on_list(std::string desc, level_pos* _pos) const +bool ShoppingList::is_on_list(std::string desc, + const level_pos* _pos) const { SETUP_POS(); return (find_thing(desc, pos) != -1); } -bool ShoppingList::del_thing(const item_def &item, level_pos* _pos) +bool ShoppingList::del_thing(const item_def &item, + const level_pos* _pos) { SETUP_POS(); @@ -2219,7 +2222,7 @@ bool ShoppingList::del_thing(const item_def &item, level_pos* _pos) return (true); } -bool ShoppingList::del_thing(std::string desc, level_pos* _pos) +bool ShoppingList::del_thing(std::string desc, const level_pos* _pos) { SETUP_POS(); diff --git a/crawl-ref/source/shopping.h b/crawl-ref/source/shopping.h index 20527d734c..5ff854159e 100644 --- a/crawl-ref/source/shopping.h +++ b/crawl-ref/source/shopping.h @@ -36,15 +36,16 @@ class ShoppingList public: ShoppingList(); - bool add_thing(const item_def &item, int cost, level_pos* pos = NULL); + bool add_thing(const item_def &item, int cost, + const level_pos* pos = NULL); bool add_thing(std::string desc, std::string buy_verb, int cost, - level_pos* pos = NULL); + const level_pos* pos = NULL); - bool is_on_list(const item_def &item, level_pos* pos = NULL) const; - bool is_on_list(std::string desc, level_pos* pos = NULL) const; + bool is_on_list(const item_def &item, const level_pos* pos = NULL) const; + bool is_on_list(std::string desc, const level_pos* pos = NULL) const; - bool del_thing(const item_def &item, level_pos* pos = NULL); - bool del_thing(std::string desc, level_pos* pos = NULL); + bool del_thing(const item_def &item, const level_pos* pos = NULL); + bool del_thing(std::string desc, const level_pos* pos = NULL); unsigned int cull_identical_items(const item_def& item, long cost = -1); |