diff options
author | Florian Diebold <flodiebold@gmail.com> | 2011-11-08 13:52:29 +0100 |
---|---|---|
committer | Florian Diebold <flodiebold@gmail.com> | 2011-11-23 19:06:47 +0100 |
commit | 6f45b76da0b15a4b77ed0d56a4feaa2002d3d185 (patch) | |
tree | 3c14f19eaaf51ce5a2f2ac0e827b191e5dcb03e0 /crawl-ref/source/kills.h | |
parent | a9079440e36eb20841ba3b84182830033a1abb64 (diff) | |
download | crawl-ref-6f45b76da0b15a4b77ed0d56a4feaa2002d3d185.tar.gz crawl-ref-6f45b76da0b15a4b77ed0d56a4feaa2002d3d185.zip |
Allow querying the kill tracker by monster_info instead of monster.
This removes a hack I added while switching tile_place_monster to
monster_info.
Diffstat (limited to 'crawl-ref/source/kills.h')
-rw-r--r-- | crawl-ref/source/kills.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crawl-ref/source/kills.h b/crawl-ref/source/kills.h index 00e96e3036..4557093a61 100644 --- a/crawl-ref/source/kills.h +++ b/crawl-ref/source/kills.h @@ -13,6 +13,7 @@ #include "enum.h" class monster; +class monster_info; class reader; class writer; @@ -20,6 +21,7 @@ class writer; struct kill_monster_desc { kill_monster_desc(const monster*); + kill_monster_desc(const monster_info&); kill_monster_desc() { } void save(writer&) const; @@ -140,7 +142,10 @@ public: int get_kills(std::vector<kill_exp> &v) const; int num_kills(const monster* mon) const; + int num_kills(const monster_info& mon) const; private: + int num_kills(kill_monster_desc desc) const; + typedef std::map<kill_monster_desc, kill_def, kill_monster_desc::less_than> kill_map; @@ -167,8 +172,10 @@ public: // Number of kills, by category. int num_kills(const monster* mon, kill_category cat) const; + int num_kills(const monster_info& mon, kill_category cat) const; // Number of kills, any category. int num_kills(const monster* mon) const; + int num_kills(const monster_info& mon) const; int total_kills() const; |