Out-of-line a function to remove an include

This commit is contained in:
Alexander van Gessel 2017-11-19 17:17:00 +01:00
parent 826c28b87c
commit f8ecc545a2
2 changed files with 16 additions and 14 deletions

View File

@ -40,6 +40,7 @@
#include "units/filter.hpp"
#include "units/map.hpp"
#include "units/types.hpp"
#include "units/unit.hpp"
#include "variable.hpp"
#include "wml_exception.hpp"
@ -103,6 +104,20 @@ const static double COMBAT_CACHE_TOLERANCY = 0.5;
const static double VILLAGE_PER_SCOUT_MULTIPLICATOR = 2.;
}
std::string data::to_string() const {
std::stringstream s;
s << "---------------Content of leader data---------------\n";
s << "For leader: " << leader->name() << "\n";
s << "ratio_score: " << ratio_score << "\n";
s << "recruit_count: " << recruit_count << "\n\n";
for (const score_map::value_type& entry : scores) {
s << std::setw(20) << entry.first <<
" score: " << std::setw(7) << entry.second << "\n";
}
s << "----------------------------------------------------\n";
return s.str();
}
recruitment::recruitment(rca_context& context, const config& cfg)
: candidate_action(context, cfg),
important_hexes_(),

View File

@ -22,7 +22,6 @@
#include "ai/composite/aspect.hpp"
#include "ai/composite/rca.hpp"
#include "units/unit.hpp"
#include "units/map.hpp"
#include <iomanip>
@ -84,19 +83,7 @@ struct data {
}
return normalized;
}
std::string to_string() const {
std::stringstream s;
s << "---------------Content of leader data---------------\n";
s << "For leader: " << leader->name() << "\n";
s << "ratio_score: " << ratio_score << "\n";
s << "recruit_count: " << recruit_count << "\n\n";
for (const score_map::value_type& entry : scores) {
s << std::setw(20) << entry.first <<
" score: " << std::setw(7) << entry.second << "\n";
}
s << "----------------------------------------------------\n";
return s.str();
}
std::string to_string() const;
};
struct cached_combat_value {