Skip to content

Commit

Permalink
Out-of-line a function to remove an include
Browse files Browse the repository at this point in the history
  • Loading branch information
AI0867 authored and GregoryLundberg committed Nov 30, 2017
1 parent f47987e commit 29df805
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
15 changes: 15 additions & 0 deletions src/ai/default/recruitment.cpp
Expand Up @@ -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"

Expand Down Expand Up @@ -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_(),
Expand Down
15 changes: 1 addition & 14 deletions src/ai/default/recruitment.hpp
Expand Up @@ -22,7 +22,6 @@

#include "ai/composite/aspect.hpp"
#include "ai/composite/rca.hpp"
#include "units/unit.hpp"
#include "units/map.hpp"

#include <iomanip>
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 29df805

Please sign in to comment.