diff options
author | Raphael Langella <raphael.langella@gmail.com> | 2012-08-26 22:50:06 +0200 |
---|---|---|
committer | Raphael Langella <raphael.langella@gmail.com> | 2012-08-26 23:06:30 +0200 |
commit | 770bcbd1844b97b671d0e47ea8313cdf2c74c5ea (patch) | |
tree | e030cf61afce9ca69b74bb38eb73734bf10f633e /crawl-ref/source/state.h | |
parent | a6c16c7f2066c854a01f25e9e6c3d8e44282a638 (diff) | |
download | crawl-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/state.h')
-rw-r--r-- | crawl-ref/source/state.h | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/crawl-ref/source/state.h b/crawl-ref/source/state.h index fd48555236..4f8230b062 100644 --- a/crawl-ref/source/state.h +++ b/crawl-ref/source/state.h @@ -28,7 +28,7 @@ public: // Track various aspects of Crawl game state. struct game_state { - std::vector<std::string> command_line_arguments; + vector<string> command_line_arguments; bool game_crashed; // The game crashed and is now in the process of // dumping crash info. @@ -59,21 +59,21 @@ struct game_state bool test; // Set if we want to run self-tests and exit. bool script; // Set if we want to run a Lua script and exit. bool build_db; // Set if we want to rebuild the db and exit. - std::vector<std::string> tests_selected; // Tests to be run. - std::vector<std::string> script_args; // Arguments to scripts. + vector<string> tests_selected; // Tests to be run. + vector<string> script_args; // Arguments to scripts. bool show_more_prompt; // Set to false to disable --more-- prompts. - std::string sprint_map; // Sprint map set on command line, if any. + string sprint_map; // Sprint map set on command line, if any. - std::string map; // Map selected in the newgame menu + string map; // Map selected in the newgame menu void (*terminal_resize_handler)(); void (*terminal_resize_check)(); bool doing_prev_cmd_again; command_type prev_cmd; - std::deque<int> prev_cmd_keys; + deque<int> prev_cmd_keys; command_type repeat_cmd; bool cmd_repeat_start; @@ -83,7 +83,7 @@ struct game_state int lua_calls_no_turn; bool stat_gain_prompt; - std::vector<std::string> startup_errors; + vector<string> startup_errors; bool level_annotation_shown; bool viewport_monster_hp; @@ -112,29 +112,29 @@ protected: void reset_cmd_repeat(); void reset_cmd_again(); - god_act_state god_act; - std::vector<god_act_state> god_act_stack; + god_act_state god_act; + vector<god_act_state> god_act_stack; - monster* mon_act; - std::vector<monster* > mon_act_stack; + monster* mon_act; + vector<monster* > mon_act_stack; public: game_state(); - void add_startup_error(const std::string &error); + void add_startup_error(const string &error); void show_startup_errors(); bool is_replaying_keys() const; bool is_repeating_cmd() const; - void cancel_cmd_repeat(std::string reason = ""); - void cancel_cmd_again(std::string reason = ""); - void cancel_cmd_all(std::string reason = ""); + void cancel_cmd_repeat(string reason = ""); + void cancel_cmd_again(string reason = ""); + void cancel_cmd_all(string reason = ""); - void cant_cmd_repeat(std::string reason = ""); - void cant_cmd_again(std::string reason = ""); - void cant_cmd_any(std::string reason = ""); + void cant_cmd_repeat(string reason = ""); + void cant_cmd_again(string reason = ""); + void cant_cmd_any(string reason = ""); void zero_turns_taken(); @@ -153,7 +153,7 @@ public: void dec_god_acting(god_type which_god); void clear_god_acting(); - std::vector<god_act_state> other_gods_acting() const; + vector<god_act_state> other_gods_acting() const; bool is_mon_acting() const; monster* which_mon_acting() const; @@ -175,11 +175,11 @@ public: bool game_is_hints_tutorial() const; // Save subdirectory used for games such as Sprint. - std::string game_type_name() const; - std::string game_savedir_path() const; - std::string game_type_qualifier() const; + string game_type_name() const; + string game_savedir_path() const; + string game_type_qualifier() const; - static std::string game_type_name_for(game_type gt); + static string game_type_name_for(game_type gt); inline void mark_last_game_won() { |