Skip to content

Commit 048631e

Browse files
committed
More ideology generation work
1 parent 7189b1a commit 048631e

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

src/headless/main.cpp

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,39 @@ static bool run_headless(Dataloader::path_vector_t const& roots, bool run_tests)
129129
// ret = false;
130130
// }
131131

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);
143+
}
144+
145+
ProvinceInstance const& province = *pop.get_location();
146+
Logger::info("Province ", province.get_identifier(), " has ", province.get_total_population(), " pops with ideology:");
147+
for (auto [ideology, support] : province.get_ideology_distribution()) {
148+
Logger::info(" ", ideology.get_identifier(), " - ", support);
149+
}
150+
151+
State const& state = *province.get_state();
152+
Logger::info("State ", state.get_identifier(), " has ", state.get_total_population(), " pops with ideology:");
153+
for (auto [ideology, support] : state.get_ideology_distribution()) {
154+
Logger::info(" ", ideology.get_identifier(), " - ", support);
155+
}
156+
157+
CountryInstance const& country = *state.get_owner();
158+
Logger::info("Country ", country.get_identifier(), " has ", country.get_total_population(), " pops with ideology:");
159+
for (auto [ideology, support] : country.get_ideology_distribution()) {
160+
Logger::info(" ", ideology.get_identifier(), " - ", support);
161+
}
162+
163+
Logger::info("National value of ", country.get_identifier(), " is ", country.get_national_value());
164+
132165
return ret;
133166
}
134167

src/openvic-simulation/scripts/Condition.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,10 @@ static bool _parse_condition_node_value_callback(
534534
ret = definition_manager.get_politics_manager().get_issue_manager().expect_reform_identifier_or_string(
535535
assign_variable_callback_pointer(value)
536536
)(node);
537+
} else if constexpr (std::same_as<T, NationalValue const*>) {
538+
ret = definition_manager.get_politics_manager().get_national_value_manager().expect_national_value_identifier_or_string(
539+
assign_variable_callback_pointer(value)
540+
)(node);
537541
} else if constexpr (std::same_as<T, Invention const*>) {
538542
ret = definition_manager.get_research_manager().get_invention_manager().expect_invention_identifier_or_string(
539543
assign_variable_callback_pointer(value)
@@ -589,6 +593,9 @@ static bool _parse_condition_node_value_callback(
589593
"which", ONE_EXACTLY, expect_identifier_or_string(assign_variable_callback_string(value.first)),
590594
"value", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(value.second))
591595
)(node);
596+
} else {
597+
Logger::error("Cannot parse condition \"", condition.get_identifier(), "\": unknown value type!");
598+
ret = false;
592599
}
593600

594601
if (ret) {

0 commit comments

Comments
 (0)