summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/kills.h
diff options
context:
space:
mode:
authorRaphael Langella <raphael.langella@gmail.com>2012-08-26 22:50:06 +0200
committerRaphael Langella <raphael.langella@gmail.com>2012-08-26 23:06:30 +0200
commit770bcbd1844b97b671d0e47ea8313cdf2c74c5ea (patch)
treee030cf61afce9ca69b74bb38eb73734bf10f633e /crawl-ref/source/kills.h
parenta6c16c7f2066c854a01f25e9e6c3d8e44282a638 (diff)
downloadcrawl-ref-770bcbd1844b97b671d0e47ea8313cdf2c74c5ea.tar.gz
crawl-ref-770bcbd1844b97b671d0e47ea8313cdf2c74c5ea.zip
Use std namespace.
I had to rename distance() (in coord.h) to distance2() because it conflicts with the STL function to compare 2 iterators. Not a bad change given how it returns the square of the distance anyway. I also had to rename the message global variable (in message.cc) to buffer. I tried to fix and improve the coding style has much as I could, but I probably missed a few given how huge and tedious it is. I also didn't touch crawl-gdb.py, and the stuff in prebuilt, rltiles/tool and util/levcomp.*, because I have no clue about those.
Diffstat (limited to 'crawl-ref/source/kills.h')
-rw-r--r--crawl-ref/source/kills.h35
1 files changed, 16 insertions, 19 deletions
diff --git a/crawl-ref/source/kills.h b/crawl-ref/source/kills.h
index 4e83404869..917163350d 100644
--- a/crawl-ref/source/kills.h
+++ b/crawl-ref/source/kills.h
@@ -65,17 +65,16 @@ public:
void merge(const kill_def &k, bool unique_monster);
- std::string info(const kill_monster_desc &md) const;
- std::string base_name(const kill_monster_desc &md) const;
+ string info(const kill_monster_desc &md) const;
+ string base_name(const kill_monster_desc &md) const;
unsigned short kills; // How many kills does the player have?
int exp; // Experience gained for slaying the beast.
// Only set *once*, even for shapeshifters.
- std::vector<unsigned short> places; // Places where we've killed the beast.
+ vector<unsigned short> places; // Places where we've killed the beast.
private:
- std::string append_places(const kill_monster_desc &md,
- const std::string &name) const;
+ string append_places(const kill_monster_desc &md, const string &name) const;
};
// Ghosts and random Pandemonium demons.
@@ -88,9 +87,9 @@ public:
void save(writer&) const;
void load(reader&);
- std::string info() const;
+ string info() const;
- std::string ghost_name;
+ string ghost_name;
int exp;
unsigned short place;
};
@@ -100,13 +99,13 @@ struct kill_exp
{
int nkills;
int exp;
- std::string base_name;
- std::string desc;
+ string base_name;
+ string desc;
monster_type monnum; // Number of the beast
int modifier; // Nature of the beast
- std::vector<unsigned short> places;
+ vector<unsigned short> places;
kill_exp(const kill_def &k, const kill_monster_desc &md)
: nkills(k.kills), exp(k.exp), base_name(k.base_name(md)),
@@ -140,16 +139,15 @@ public:
void save(writer&) const;
void load(reader&);
- int get_kills(std::vector<kill_exp> &v) const;
+ int get_kills(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;
- typedef std::vector<kill_ghost> ghost_vec;
+ typedef map<kill_monster_desc, kill_def,
+ kill_monster_desc::less_than> kill_map;
+ typedef vector<kill_ghost> ghost_vec;
kill_map kills;
ghost_vec ghosts;
@@ -179,15 +177,14 @@ public:
int total_kills() const;
- std::string kill_info() const;
+ string kill_info() const;
private:
const char *category_name(kill_category kc) const;
Kills categorized_kills[KC_NCATEGORIES];
private:
- void add_kill_info(std::string &, std::vector<kill_exp> &,
- int count, const char *c, bool separator)
- const;
+ void add_kill_info(string &, vector<kill_exp> &,
+ int count, const char *c, bool separator) const;
};
enum KILL_DUMP_OPTIONS