Author: mordante
Date: Sun Apr 19 17:05:12 2009
New Revision: 35049
URL: http://svn.gna.org/viewcvs/wesnoth?rev=35049&view=rev
Log:
Initialize all members.
Modified:
trunk/src/ai/formula_candidates.cpp
trunk/src/ai/formula_candidates.hpp
Modified: trunk/src/ai/formula_candidates.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ai/formula_candidates.cpp?rev=35049&r1=35048&r2=35049&view=diff
==============================================================================
--- trunk/src/ai/formula_candidates.cpp (original)
+++ trunk/src/ai/formula_candidates.cpp Sun Apr 19 17:05:12 2009
@@ -76,11 +76,14 @@
return true;
}
-base_candidate_action::base_candidate_action(const std::string& name,const
std::string& type,const config& cfg, function_symbol_table* function_table) :
+base_candidate_action::base_candidate_action(const std::string& name,
+ const std::string& type, const config& cfg,
+ function_symbol_table* function_table) :
name_(name),
type_(type),
eval_(new game_logic::formula(cfg["evaluation"], function_table)),
- action_(new game_logic::formula(cfg["action"], function_table))
+ action_(new game_logic::formula(cfg["action"], function_table)),
+ score_(0)
{}
int base_candidate_action::execute_formula(const const_formula_ptr& formula,
@@ -100,8 +103,11 @@
return res;
}
-candidate_action_with_filters::candidate_action_with_filters(const
std::string& name, const std::string& type,const config& cfg,
function_symbol_table* function_table) :
- base_candidate_action(name, type, cfg, function_table)
+candidate_action_with_filters::candidate_action_with_filters(
+ const std::string& name, const std::string& type,
+ const config& cfg, function_symbol_table* function_table)
+ : base_candidate_action(name, type, cfg, function_table)
+ , filter_map_()
{
const config & filter_params = cfg.child("filter");
@@ -116,8 +122,11 @@
}
}
-move_candidate_action::move_candidate_action(const std::string& name, const
std::string& type,const config& cfg, function_symbol_table* function_table) :
- candidate_action_with_filters(name, type, cfg, function_table)
+move_candidate_action::move_candidate_action(const std::string& name,
+ const std::string& type, const config& cfg,
+ function_symbol_table* function_table)
+ : candidate_action_with_filters(name, type, cfg, function_table)
+ , my_unit_()
{}
void move_candidate_action::evaluate(formula_ai* ai, unit_map& units)
@@ -156,8 +165,12 @@
callable.add("me", my_unit_callable);
}
-attack_candidate_action::attack_candidate_action(const std::string& name,
const std::string& type,const config& cfg, function_symbol_table*
function_table) :
- candidate_action_with_filters(name, type, cfg, function_table)
+attack_candidate_action::attack_candidate_action(const std::string& name,
+ const std::string& type, const config& cfg,
+ function_symbol_table* function_table)
+ : candidate_action_with_filters(name, type, cfg, function_table)
+ , my_unit_()
+ , enemy_unit_()
{}
void attack_candidate_action::evaluate(formula_ai* ai, unit_map& units)
Modified: trunk/src/ai/formula_candidates.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ai/formula_candidates.hpp?rev=35049&r1=35048&r2=35049&view=diff
==============================================================================
--- trunk/src/ai/formula_candidates.hpp (original)
+++ trunk/src/ai/formula_candidates.hpp Sun Apr 19 17:05:12 2009
@@ -73,7 +73,10 @@
//this class is responsible for managing candidate actions
class candidate_action_manager {
public:
- candidate_action_manager() {}
+ candidate_action_manager()
+ : evaluated_candidate_actions_()
+ , candidate_actions_()
+ {}
//register candidate actions from config
void load_config(const config& cfg, formula_ai* ai,
function_symbol_table* function_table);
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits