Code cleanup, obsolete code removal
This commit is contained in:
parent
bada467e71
commit
40b0ee8f1a
4 changed files with 0 additions and 22 deletions
|
@ -51,8 +51,6 @@ candidate_action_ptr candidate_action_manager::load_candidate_action_from_config
|
|||
new_ca = candidate_action_ptr(new move_candidate_action(name, type, rc_action, function_table ));
|
||||
} else if( type == "attack") {
|
||||
new_ca = candidate_action_ptr(new attack_candidate_action(name, type, rc_action, function_table ));
|
||||
} else if( type == "support") {
|
||||
new_ca = candidate_action_ptr(new support_candidate_action(name, type, rc_action, function_table ));
|
||||
} else {
|
||||
ERR_AI << "Unknown candidate action type: " << type << "\n";
|
||||
}
|
||||
|
@ -299,9 +297,4 @@ void attack_candidate_action::update_callable_map(game_logic::map_formula_callab
|
|||
callable.add("target", enemy_unit_);
|
||||
}
|
||||
|
||||
|
||||
support_candidate_action::support_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)
|
||||
{}
|
||||
|
||||
}
|
||||
|
|
|
@ -161,10 +161,6 @@ protected:
|
|||
variant enemy_unit_;
|
||||
};
|
||||
|
||||
class support_candidate_action : public candidate_action_with_filters {
|
||||
public:
|
||||
support_candidate_action(const std::string& name, const std::string& type,const config& cfg, function_symbol_table* function_table);
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* AI_FORMULA_CANDIDATES_HPP_INCLUDED */
|
||||
|
|
|
@ -111,7 +111,6 @@ unit::unit(const unit& o):
|
|||
unit_formula_(o.unit_formula_),
|
||||
unit_loop_formula_(o.unit_loop_formula_),
|
||||
unit_priority_formula_(o.unit_priority_formula_),
|
||||
unit_on_fail_formula_(o.unit_on_fail_formula_),
|
||||
formula_vars_(o.formula_vars_ ? new game_logic::map_formula_callable(*o.formula_vars_) : o.formula_vars_),
|
||||
|
||||
recruits_(o.recruits_),
|
||||
|
@ -194,7 +193,6 @@ unit::unit(unit_map* unitmap, const config& cfg,
|
|||
unit_formula_(),
|
||||
unit_loop_formula_(),
|
||||
unit_priority_formula_(),
|
||||
unit_on_fail_formula_(),
|
||||
formula_vars_(),
|
||||
recruits_(),
|
||||
movement_(0),
|
||||
|
@ -272,7 +270,6 @@ unit::unit(const config& cfg,bool use_traits) :
|
|||
unit_formula_(),
|
||||
unit_loop_formula_(),
|
||||
unit_priority_formula_(),
|
||||
unit_on_fail_formula_(),
|
||||
formula_vars_(),
|
||||
recruits_(),
|
||||
movement_(0),
|
||||
|
@ -377,7 +374,6 @@ unit::unit(unit_map *unitmap, const unit_type *t, int side,
|
|||
unit_formula_(),
|
||||
unit_loop_formula_(),
|
||||
unit_priority_formula_(),
|
||||
unit_on_fail_formula_(),
|
||||
formula_vars_(),
|
||||
recruits_(),
|
||||
movement_(0),
|
||||
|
@ -1406,7 +1402,6 @@ void unit::read(const config& cfg, bool use_traits, game_state* state)
|
|||
unit_formula_ = ai["formula"];
|
||||
unit_loop_formula_ = ai["loop_formula"];
|
||||
unit_priority_formula_ = ai["priority"];
|
||||
unit_on_fail_formula_ = ai["on_fail"];
|
||||
|
||||
if (const config &ai_vars = ai.child("vars"))
|
||||
{
|
||||
|
@ -1587,9 +1582,6 @@ void unit::write(config& cfg) const
|
|||
if (has_priority_formula())
|
||||
ai["priority"] = unit_priority_formula_;
|
||||
|
||||
if (has_on_fail_formula())
|
||||
ai["on_fail"] = unit_on_fail_formula_;
|
||||
|
||||
|
||||
if (formula_vars_ && formula_vars_->empty() == false)
|
||||
{
|
||||
|
|
|
@ -303,11 +303,9 @@ public:
|
|||
bool has_formula() const { return !unit_formula_.empty(); }
|
||||
bool has_loop_formula() const { return !unit_loop_formula_.empty(); }
|
||||
bool has_priority_formula() const { return !unit_priority_formula_.empty(); }
|
||||
bool has_on_fail_formula() const { return !unit_on_fail_formula_.empty(); }
|
||||
const std::string& get_formula() const { return unit_formula_; }
|
||||
const std::string& get_loop_formula() const { return unit_loop_formula_; }
|
||||
const std::string& get_priority_formula() const { return unit_priority_formula_; }
|
||||
const std::string& get_on_fail_formula() const { return unit_on_fail_formula_; }
|
||||
|
||||
void reset_modifications();
|
||||
void backup_state();
|
||||
|
@ -397,7 +395,6 @@ private:
|
|||
std::string unit_formula_;
|
||||
std::string unit_loop_formula_;
|
||||
std::string unit_priority_formula_;
|
||||
std::string unit_on_fail_formula_;
|
||||
game_logic::map_formula_callable_ptr formula_vars_;
|
||||
|
||||
std::vector<std::string> recruits_;
|
||||
|
|
Loading…
Add table
Reference in a new issue