summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/itemprop.h
diff options
context:
space:
mode:
authorTanner Swett <tannerswett@gmail.com>2014-07-14 15:58:49 -0400
committerNicholas Feinberg <pleasingfung@gmail.com>2014-07-14 21:00:33 -0700
commitda5f0e399819c540483395c2579c9d15bc80dec3 (patch)
tree2aa77ad116dedc38f2e3ca4bde5aac701d7a06ca /crawl-ref/source/itemprop.h
parentd078c632a9a6cd162fa9c18af950d520d7b92a12 (diff)
downloadcrawl-ref-da5f0e399819c540483395c2579c9d15bc80dec3.tar.gz
crawl-ref-da5f0e399819c540483395c2579c9d15bc80dec3.zip
Make str_to_weapon use existing item data
Diffstat (limited to 'crawl-ref/source/itemprop.h')
-rw-r--r--crawl-ref/source/itemprop.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/crawl-ref/source/itemprop.h b/crawl-ref/source/itemprop.h
index a3711284d6..1ba76e3e88 100644
--- a/crawl-ref/source/itemprop.h
+++ b/crawl-ref/source/itemprop.h
@@ -191,6 +191,7 @@ string item_base_name(const item_def &item);
string item_base_name(object_class_type type, int sub_type);
string food_type_name(int sub_type);
const char *weapon_base_name(weapon_type subtype) IMMUTABLE;
+weapon_type name_nospace_to_weapon(string name_nospace);
void seen_item(const item_def &item);
@@ -200,4 +201,10 @@ static inline bool is_weapon(const item_def &item)
|| item.base_type == OBJ_STAVES
|| item.base_type == OBJ_RODS;
}
+
+inline void remove_whitespace(string &str)
+{
+ str.erase(remove_if(str.begin(), str.end(),
+ static_cast<int(*)(int)>(isspace)), str.end());
+}
#endif