@@ -90,43 +90,56 @@ static bool run_headless(Dataloader::path_vector_t const& roots, bool run_tests)
9090 ret &= game_manager.update_clock ();
9191
9292 // TODO - REMOVE TEST CODE
93- Logger::info (" ===== Ranking system test... =====" );
94- if (game_manager.get_instance_manager ()) {
95- const auto print_ranking_list = [](std::string_view title, std::vector<CountryInstance*> const & countries) -> void {
96- std::string text;
97- for (CountryInstance const * country : countries) {
98- text += StringUtils::append_string_views (
99- " \n " , country->get_identifier (),
100- " - Total #" , std::to_string (country->get_total_rank ()), " (" , country->get_total_score ().to_string (1 ),
101- " ), Prestige #" , std::to_string (country->get_prestige_rank ()), " (" , country->get_prestige ().to_string (1 ),
102- " ), Industry #" , std::to_string (country->get_industrial_rank ()), " (" , country->get_industrial_power ().to_string (1 ),
103- " ), Military #" , std::to_string (country->get_military_rank ()), " (" , country->get_military_power ().to_string (1 ), " )"
104- );
105- }
106- Logger::info (title, " :" , text);
107- };
108-
109- CountryInstanceManager const & country_instance_manager =
110- game_manager.get_instance_manager ()->get_country_instance_manager ();
111-
112- std::vector<CountryInstance*> const & great_powers = country_instance_manager.get_great_powers ();
113- print_ranking_list (" Great Powers" , great_powers);
114- print_ranking_list (" Secondary Powers" , country_instance_manager.get_secondary_powers ());
115- print_ranking_list (" All countries" , country_instance_manager.get_total_ranking ());
116-
117- Logger::info (" ===== RGO test... =====" );
118- for (size_t i = 0 ; i < std::min<size_t >(3 , great_powers.size ()); ++i) {
119- CountryInstance const & great_power = *great_powers[i];
120- ProvinceInstance const * const capital_province = great_power.get_capital ();
121- if (capital_province == nullptr ) {
122- Logger::warning (great_power.get_identifier (), " has no capital ProvinceInstance set." );
123- } else {
124- print_rgo (*capital_province);
125- }
126- }
127- } else {
128- Logger::error (" Instance manager not available!" );
129- ret = false ;
93+ // Logger::info("===== Ranking system test... =====");
94+ // if (game_manager.get_instance_manager()) {
95+ // const auto print_ranking_list = [](std::string_view title, std::vector<CountryInstance*> const& countries) -> void {
96+ // std::string text;
97+ // for (CountryInstance const* country : countries) {
98+ // text += StringUtils::append_string_views(
99+ // "\n ", country->get_identifier(),
100+ // " - Total #", std::to_string(country->get_total_rank()), " (", country->get_total_score().to_string(1),
101+ // "), Prestige #", std::to_string(country->get_prestige_rank()), " (", country->get_prestige().to_string(1),
102+ // "), Industry #", std::to_string(country->get_industrial_rank()), " (", country->get_industrial_power().to_string(1),
103+ // "), Military #", std::to_string(country->get_military_rank()), " (", country->get_military_power().to_string(1), ")"
104+ // );
105+ // }
106+ // Logger::info(title, ":", text);
107+ // };
108+
109+ // CountryInstanceManager const& country_instance_manager =
110+ // game_manager.get_instance_manager()->get_country_instance_manager();
111+
112+ // std::vector<CountryInstance*> const& great_powers = country_instance_manager.get_great_powers();
113+ // print_ranking_list("Great Powers", great_powers);
114+ // print_ranking_list("Secondary Powers", country_instance_manager.get_secondary_powers());
115+ // print_ranking_list("All countries", country_instance_manager.get_total_ranking());
116+
117+ // Logger::info("===== RGO test... =====");
118+ // for (size_t i = 0; i < std::min<size_t>(3, great_powers.size()); ++i) {
119+ // CountryInstance const& great_power = *great_powers[i];
120+ // ProvinceInstance const* const capital_province = great_power.get_capital();
121+ // if (capital_province == nullptr) {
122+ // Logger::warning(great_power.get_identifier(), " has no capital ProvinceInstance set.");
123+ // } else {
124+ // print_rgo(*capital_province);
125+ // }
126+ // }
127+ // } else {
128+ // Logger::error("Instance manager not available!");
129+ // ret = false;
130+ // }
131+
132+ Pop const & pop = *game_manager.get_instance_manager ()->get_map_instance ().get_province_instance_by_index (300 )->get_pops ().begin ();
133+
134+ Logger::info (
135+ " Pop has type " , pop.get_type ()->get_identifier (),
136+ " , size " , pop.get_size (),
137+ " , culture " , pop.get_culture ().get_identifier (),
138+ " , religion " , pop.get_religion ().get_identifier (),
139+ " , ideology:"
140+ );
141+ for (auto [ideology, support] : pop.get_ideology_distribution ()) {
142+ Logger::info (" " , ideology.get_identifier (), " - " , support);
130143 }
131144
132145 if (ret) {
@@ -139,6 +152,26 @@ static bool run_headless(Dataloader::path_vector_t const& roots, bool run_tests)
139152 Logger::info (" Ran " , --ticks_passed, " ticks in " , end_time - start_time);
140153 }
141154
155+ ProvinceInstance const & province = *pop.get_location ();
156+ Logger::info (" Province " , province.get_identifier (), " has " , province.get_total_population (), " pops with ideology:" );
157+ for (auto [ideology, support] : province.get_ideology_distribution ()) {
158+ Logger::info (" " , ideology.get_identifier (), " - " , support);
159+ }
160+
161+ State const & state = *province.get_state ();
162+ Logger::info (" State " , state.get_identifier (), " has " , state.get_total_population (), " pops with ideology:" );
163+ for (auto [ideology, support] : state.get_ideology_distribution ()) {
164+ Logger::info (" " , ideology.get_identifier (), " - " , support);
165+ }
166+
167+ CountryInstance const & country = *state.get_owner ();
168+ Logger::info (" Country " , country.get_identifier (), " has " , country.get_total_population (), " pops with ideology:" );
169+ for (auto [ideology, support] : country.get_ideology_distribution ()) {
170+ Logger::info (" " , ideology.get_identifier (), " - " , support);
171+ }
172+
173+ Logger::info (" National value of " , country.get_identifier (), " is " , country.get_national_value ());
174+
142175 return ret;
143176}
144177
0 commit comments