summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/database.h
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-24 05:04:58 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-24 05:04:58 +0000
commitee8bfe95919cb737826f04629698df9258200020 (patch)
treeb8b4f48ee90c6c6c3efade2c8793fdd0f249f230 /crawl-ref/source/database.h
parentbcbd0cca53601270c2b128eb9c89a9185cb40336 (diff)
downloadcrawl-ref-ee8bfe95919cb737826f04629698df9258200020.tar.gz
crawl-ref-ee8bfe95919cb737826f04629698df9258200020.zip
?/ now asks if you want to describe a monster, spell, or feature, and
filters out matches if they aren't of the desired type. If there's more than one match, after selecting a match to look at, exiting from the description will return you to the menu, rather than to the dungeon. If you've asked for monsters, you can toggle sorting of the menu between alphabetical and by aproximated monster toughness (this probably still needs some work, since it seems to say that ordinary worms are tougher than brain worms). Only the monster symbol is coloured when showing a menu of monsters to describe. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2185 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/database.h')
-rw-r--r--crawl-ref/source/database.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/crawl-ref/source/database.h b/crawl-ref/source/database.h
index 357ab62a9a..09b90364ea 100644
--- a/crawl-ref/source/database.h
+++ b/crawl-ref/source/database.h
@@ -40,16 +40,22 @@ void databaseSystemShutdown();
DBM *openDB(const char *dbFilename);
datum database_fetch(DBM *database, const std::string &key);
+typedef bool (*db_find_filter)(std::string key, std::string body);
+
std::vector<std::string> database_find_keys(DBM *database,
const std::string &regex,
- bool ignore_case = false);
+ bool ignore_case = false,
+ db_find_filter filter = NULL);
std::vector<std::string> database_find_bodies(DBM *database,
const std::string &regex,
- bool ignore_case = false);
+ bool ignore_case = false,
+ db_find_filter filter = NULL);
std::string getLongDescription(const std::string &key);
-std::vector<std::string> getLongDescKeysByRegex(const std::string &regex);
-std::vector<std::string> getLongDescBodiesByRegex(const std::string &regex);
+std::vector<std::string> getLongDescKeysByRegex(const std::string &regex,
+ db_find_filter filter = NULL);
+std::vector<std::string> getLongDescBodiesByRegex(const std::string &regex,
+ db_find_filter filter = NULL);
std::string getShoutString(const std::string &monst,
const std::string &suffix = "");