Author: mordante
Date: Sun Mar 13 19:59:05 2011
New Revision: 48886

URL: http://svn.gna.org/viewcvs/wesnoth?rev=48886&view=rev
Log:
Append private variables with an underscore.

Modified:
    trunk/src/gamestatus.cpp
    trunk/src/gamestatus.hpp
    trunk/src/variable.cpp

Modified: trunk/src/gamestatus.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gamestatus.cpp?rev=48886&r1=48885&r2=48886&view=diff
==============================================================================
--- trunk/src/gamestatus.cpp (original)
+++ trunk/src/gamestatus.cpp Sun Mar 13 19:59:05 2011
@@ -161,9 +161,9 @@
                snapshot(),
                last_selected(map_location::null_location),
                rng_(),
-               variables(),
-               temporaries(),
-               generator_setter(&recorder),
+               variables_(),
+               temporaries_(),
+               generator_setter_(&recorder),
                classification_(),
                mp_settings_(),
                phase_(INITIAL),
@@ -260,9 +260,9 @@
                snapshot(),
                last_selected(map_location::null_location),
                rng_(cfg),
-               variables(),
-               temporaries(),
-               generator_setter(&recorder),
+               variables_(),
+               temporaries_(),
+               generator_setter_(&recorder),
                classification_(cfg),
                mp_settings_(cfg),
                phase_(INITIAL),
@@ -360,7 +360,7 @@
        cfg["end_text"] = classification_.end_text;
        cfg["end_text_duration"] = str_cast<unsigned 
int>(classification_.end_text_duration);
 
-       cfg.add_child("variables", variables);
+       cfg.add_child("variables", variables_);
 
        for(std::map<std::string, wml_menu_item *>::const_iterator 
j=wml_menu_items.begin();
            j!=wml_menu_items.end(); ++j) {
@@ -482,7 +482,7 @@
        variable_info to_get(key, false, variable_info::TYPE_SCALAR);
        if (!to_get.is_valid)
        {
-               config::attribute_value &to_return = temporaries[key];
+               config::attribute_value &to_return = temporaries_[key];
                if (key.size() > 7 && key.substr(key.size() - 7) == ".length") {
                        // length is a special attribute, so guarantee its 
correctness
                        to_return = 0;
@@ -551,9 +551,9 @@
        snapshot(),
        last_selected(),
        rng_(),
-       variables(),
-       temporaries(),
-       generator_setter(&recorder),
+       variables_(),
+       temporaries_(),
+       generator_setter_(&recorder),
        classification_(),
        mp_settings_(),
        phase_(INITIAL),
@@ -585,7 +585,7 @@
        starting_pos = state.starting_pos;
        snapshot = state.snapshot;
        last_selected = state.last_selected;
-       variables = state.variables;
+       variables_ = state.variables_;
 
        return *this;
 }
@@ -595,7 +595,7 @@
 }
 
 void game_state::set_variables(const config& vars) {
-       variables = vars;
+       variables_ = vars;
 }
 
 
@@ -999,7 +999,7 @@
        out.write_key_val("random_seed", 
lexical_cast<std::string>(rng_.get_random_seed()));
        out.write_key_val("random_calls", 
lexical_cast<std::string>(rng_.get_random_calls()));
        if (write_variables) {
-               out.write_child("variables", variables);
+               out.write_child("variables", variables_);
        }
 
        for(std::map<std::string, wml_menu_item *>::const_iterator j = 
wml_menu_items.begin();

Modified: trunk/src/gamestatus.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gamestatus.hpp?rev=48886&r1=48885&r2=48886&view=diff
==============================================================================
--- trunk/src/gamestatus.hpp (original)
+++ trunk/src/gamestatus.hpp Sun Mar 13 19:59:05 2011
@@ -90,7 +90,7 @@
        std::vector<scoped_wml_variable*> scoped_variables;
        std::map<std::string, wml_menu_item*> wml_menu_items;
 
-       const config& get_variables() const { return variables; }
+       const config& get_variables() const { return variables_; }
        void set_variables(const config& vars);
 
        void set_menu_items(const config::const_child_itors &menu_items);
@@ -172,10 +172,10 @@
        map_location last_selected;
 
 private:
-       rand_rng::simple_rng rng_ ;
-       config variables;
-       mutable config temporaries; // lengths of arrays, etc.
-       const rand_rng::set_random_generator generator_setter; /**< Make sure 
that rng is initialized first */
+       rand_rng::simple_rng rng_;
+       config variables_;
+       mutable config temporaries_; // lengths of arrays, etc.
+       const rand_rng::set_random_generator generator_setter_; /**< Make sure 
that rng is initialized first */
        friend struct variable_info;
        game_classification classification_;
        mp_game_settings mp_settings_;

Modified: trunk/src/variable.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/variable.cpp?rev=48886&r1=48885&r2=48886&view=diff
==============================================================================
--- trunk/src/variable.cpp (original)
+++ trunk/src/variable.cpp Sun Mar 13 19:59:05 2011
@@ -585,7 +585,7 @@
        assert(repos != NULL);
        activate_scope_variable(varname);
 
-       vars = &repos->variables;
+       vars = &repos->variables_;
        key = varname;
        std::string::const_iterator itor = std::find(key.begin(),key.end(),'.');
        int dot_index = key.find('.');
@@ -634,17 +634,17 @@
                        case variable_info::TYPE_CONTAINER:
                                WRN_NG << "variable_info: using reserved WML 
variable as wrong type, "
                                        << varname << std::endl;
-                               is_valid = force_valid || 
repos->temporaries.child(varname);
+                               is_valid = force_valid || 
repos->temporaries_.child(varname);
                                break;
                        case variable_info::TYPE_SCALAR:
                        default:
                                // Store the length of the array as a temporary 
variable
-                               repos->temporaries[varname] = int(size);
+                               repos->temporaries_[varname] = int(size);
                                is_valid = true;
                                break;
                        }
                        key = varname;
-                       vars = &repos->temporaries;
+                       vars = &repos->temporaries_;
                        return;
                }
 


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to