From 59068ce8dae39e2f6a35861d371d0ce6b01732d9 Mon Sep 17 00:00:00 2001 From: Matthew Cline Date: Sat, 31 Oct 2009 02:16:00 -0700 Subject: Auto-update shopping-list when new items seen Automatically update the shopping list if you see the same item for less cost in another shop, or if you get an item identical to one on the shopping list (currently only applies to jewellery, books and staves). --- crawl-ref/source/shopping.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/shopping.h') diff --git a/crawl-ref/source/shopping.h b/crawl-ref/source/shopping.h index b74d056899..75ed26a2ac 100644 --- a/crawl-ref/source/shopping.h +++ b/crawl-ref/source/shopping.h @@ -46,16 +46,18 @@ public: bool del_thing(const item_def &item, level_pos* pos = NULL); bool del_thing(std::string desc, level_pos* pos = NULL); - int size() const; - - void move_things(const coord_def &src, const coord_def &dst); + unsigned int cull_identical_items(const item_def& item, long cost = -1); void gold_changed(int old_amount, int new_amount); + void move_things(const coord_def &src, const coord_def &dst); + void display_list(); void refresh(); + int size() const; + private: CrawlVector* list; @@ -75,8 +77,12 @@ private: static long thing_cost(const CrawlHashTable& thing); static level_pos thing_pos(const CrawlHashTable& thing); - static std::string name_thing(const CrawlHashTable& thing); - static std::string describe_thing(const CrawlHashTable& thing); + static std::string name_thing(const CrawlHashTable& thing, + description_level_type descrip = DESC_PLAIN); + static std::string describe_thing(const CrawlHashTable& thing, + description_level_type descrip = DESC_PLAIN); + static std::string item_name_simple(const item_def& item, + bool ident = false); }; extern ShoppingList shopping_list; -- cgit v1.2.3-54-g00ecf