remove a no longer needed method from game_state
This commit is contained in:
parent
56e0560858
commit
50a3fd59ad
3 changed files with 5 additions and 14 deletions
|
@ -1819,8 +1819,7 @@ bool event_handler::handle_event_command(const queued_event& event_info,
|
|||
}
|
||||
const std::string mode = cfg["mode"];
|
||||
config to_store;
|
||||
variable_info varinfo = state_of_game->get_variable_info(variable, true,
|
||||
variable_info::TYPE_ARRAY);
|
||||
variable_info varinfo(variable, true, variable_info::TYPE_ARRAY);
|
||||
|
||||
const bool kill_units = utils::string_bool(cfg["kill"]);
|
||||
|
||||
|
|
|
@ -1014,12 +1014,12 @@ void extract_summary_from_config(config& cfg_save, config& cfg_summary)
|
|||
|
||||
t_string& game_state::get_variable(const std::string& key)
|
||||
{
|
||||
return get_variable_info(key, true, variable_info::TYPE_SCALAR).as_scalar();
|
||||
return variable_info(key, true, variable_info::TYPE_SCALAR).as_scalar();
|
||||
}
|
||||
|
||||
const t_string& game_state::get_variable_const(const std::string& key) const
|
||||
{
|
||||
variable_info to_get = get_variable_info(key, false, variable_info::TYPE_SCALAR);
|
||||
variable_info to_get(key, false, variable_info::TYPE_SCALAR);
|
||||
if(!to_get.is_valid) return temporaries[key];
|
||||
return to_get.as_scalar();
|
||||
}
|
||||
|
@ -1028,7 +1028,7 @@ config& game_state::get_variable_cfg(const std::string& key)
|
|||
{
|
||||
//FIXME: since this method is serving double duty for Arrays and Containers,
|
||||
//we must validate type as an Array to be safe
|
||||
return get_variable_info(key, true, variable_info::TYPE_ARRAY).as_container();
|
||||
return variable_info(key, true, variable_info::TYPE_ARRAY).as_container();
|
||||
}
|
||||
|
||||
void game_state::set_variable(const std::string& key, const t_string& value)
|
||||
|
@ -1038,7 +1038,7 @@ void game_state::set_variable(const std::string& key, const t_string& value)
|
|||
|
||||
config& game_state::add_variable_cfg(const std::string& key, const config& value)
|
||||
{
|
||||
variable_info to_add = get_variable_info(key, true, variable_info::TYPE_ARRAY);
|
||||
variable_info to_add(key, true, variable_info::TYPE_ARRAY);
|
||||
return to_add.vars->add_child(to_add.key, value);
|
||||
}
|
||||
|
||||
|
@ -1065,11 +1065,6 @@ void game_state::clear_variable(const std::string& varname)
|
|||
}
|
||||
}
|
||||
|
||||
variable_info game_state::get_variable_info(const std::string& varname, bool force_valid, variable_info::TYPE vartype) const
|
||||
{
|
||||
return variable_info(varname, force_valid, vartype);
|
||||
}
|
||||
|
||||
static void clear_wmi(std::map<std::string, wml_menu_item*>& gs_wmi) {
|
||||
std::map<std::string, wml_menu_item*>::iterator itor = gs_wmi.begin();
|
||||
for(itor = gs_wmi.begin(); itor != gs_wmi.end(); ++itor) {
|
||||
|
|
|
@ -117,9 +117,6 @@ public:
|
|||
|
||||
//Variable access
|
||||
|
||||
variable_info get_variable_info(const std::string& varname, bool force_valid=true,
|
||||
variable_info::TYPE validation_type=variable_info::TYPE_UNSPECIFIED) const;
|
||||
|
||||
t_string& get_variable(const std::string& varname);
|
||||
virtual const t_string& get_variable_const(const std::string& varname) const;
|
||||
config& get_variable_cfg(const std::string& varname);
|
||||
|
|
Loading…
Add table
Reference in a new issue