9 auto new_id = context.
state.
world.create_religion();
11 context.
state.
world.religion_set_name(new_id, name_id);
16 parse_religion_def(gen, err, new_context);
20 dcon::culture_group_id new_id = context.
state.
world.create_culture_group();
22 context.
state.
world.culture_group_set_name(new_id, name_id);
23 context.
state.
world.culture_group_set_is_overseas(new_id,
true);
27 parse_culture_group(gen, err, new_context);
38 parse_culture(gen, err, new_context);
43 parse_names_list(gen, err, new_context);
47 parse_names_list(gen, err, new_context);
64 dcon::ideology_group_id new_id = context.
state.
world.create_ideology_group();
67 context.
state.
world.ideology_group_set_name(new_id, name_id);
71 parse_ideology_group(gen, err, new_context);
80 }
else if(
is_fixed_token_ci(name.data(), name.data() + name.length(),
"political_reforms")) {
82 }
else if(
is_fixed_token_ci(name.data(), name.data() + name.length(),
"social_reforms")) {
84 }
else if(
is_fixed_token_ci(name.data(), name.data() + name.length(),
"economic_reforms")) {
86 }
else if(
is_fixed_token_ci(name.data(), name.data() + name.length(),
"military_reforms")) {
93 parse_issues_group(gen, err, new_context);
99 case ::culture::issue_category::party: {
110 parse_issue(gen, err, new_context);
112 case ::culture::issue_category::economic: {
123 parse_issue(gen, err, new_context);
125 case ::culture::issue_category::social: {
135 parse_issue(gen, err, new_context);
137 case ::culture::issue_category::political: {
147 parse_issue(gen, err, new_context);
149 case ::culture::issue_category::military: {
160 parse_issue(gen, err, new_context);
178 bool assigned =
false;
180 for(
uint32_t i = 0; i < existing_options.size(); ++i) {
181 if(!(existing_options[i])) {
182 existing_options[i] = new_id;
201 bool assigned =
false;
203 for(
uint32_t i = 0; i < existing_options.size(); ++i) {
204 if(!(existing_options[i])) {
205 existing_options[i] = new_id;
218 dcon::government_type_id new_id = context.
state.
world.create_government_type();
222 context.
state.
world.government_type_set_name(new_id, name_id);
228 parse_government_type(gen, err, new_context);
244 dcon::rebel_type_id new_id = context.
state.
world.create_rebel_type();
251 context.
state.
world.rebel_type_set_name(new_id, name_id);
252 context.
state.
world.rebel_type_set_description(new_id, desc_id);
253 context.
state.
world.rebel_type_set_army_name(new_id, army_id);
254 context.
state.
world.rebel_type_set_title(new_id, title_id);
267 }
else if(
is_fixed_token_ci(name.data(), name.data() + name.length(),
"navy_tech")) {
269 }
else if(
is_fixed_token_ci(name.data(), name.data() + name.length(),
"commerce_tech")) {
271 }
else if(
is_fixed_token_ci(name.data(), name.data() + name.length(),
"culture_tech")) {
273 }
else if(
is_fixed_token_ci(name.data(), name.data() + name.length(),
"industry_tech")) {
276 }
else if(
is_fixed_token_ci(name.data(), name.data() + name.length(),
"military_theory_tech")) {
278 }
else if(
is_fixed_token_ci(name.data(), name.data() + name.length(),
"population_tech")) {
280 }
else if(
is_fixed_token_ci(name.data(), name.data() + name.length(),
"diplomacy_tech")) {
282 }
else if(
is_fixed_token_ci(name.data(), name.data() + name.length(),
"flavor_tech")) {
289 parse_tech_folder_list(gen, err, new_context);
293 auto tech_folder = open_directory(root,
NATIVE(
"technologies"));
296 auto content = view_contents(*tech_file);
297 err.
file_name = std::string(name) +
".txt";
298 token_generator file_gen(content.data, content.data + content.file_size);
299 parse_technology_sub_file(file_gen, err, context);
306 auto new_modifier = context.
state.
world.create_modifier();
309 context.
state.
world.modifier_set_name(new_modifier, name_id);
312 auto school = parse_modifier_base(gen, err, context);
315 context.
state.
world.modifier_set_national_values(new_modifier, school.force_national_mod());
319 auto new_id = context.
state.
world.create_technology();
322 context.
state.
world.technology_set_name(new_id, name_id);
328 auto gfx = open_directory(root,
NATIVE(
"gfx"));
329 auto pictures = open_directory(gfx,
NATIVE(
"pictures"));
330 auto tech = open_directory(pictures,
NATIVE(
"tech"));
334 return std::string(name) +
".tga";
336 return std::string(name) +
".tga";
338 return std::string(name) +
".png";
340 return std::string(
"noimage.tga");
345 context.
state.
world.technology_set_image(new_id, it->second);
350 auto new_gfx_id = dcon::gfx_object_id(uint16_t(gfxindex));
367 context.
state.
world.technology_set_image(new_id, new_gfx_id);
430 return parse_commodity_array(gen, err, context.
outer_context);
441 auto opt = it->second.id;
452 err.
accumulated_errors +=
"attempted to set a vote modifier for unkown issue option " + std::string(name) +
" in file " + err.
file_name +
"\n";
472 crime_modifier crime_body = parse_crime_modifier(gen, err, context);
477 auto new_modifier = context.
state.
world.create_modifier();
523 if(opt.next_to_add_n != 0 || opt.next_to_add_p != 0) {
524 auto new_modifier = context.
state.
world.create_modifier();
525 context.
state.
world.modifier_set_name(new_modifier, context.
state.
world.issue_option_get_name(
id));
527 context.
state.
world.modifier_set_national_values(new_modifier, opt.force_national_mod());
528 context.
state.
world.issue_option_set_modifier(
id, new_modifier);
536 if(opt.next_to_add_n != 0 || opt.next_to_add_p != 0) {
537 auto new_modifier = context.
state.
world.create_modifier();
538 context.
state.
world.modifier_set_name(new_modifier, context.
state.
world.reform_option_get_name(
id));
540 context.
state.
world.modifier_set_national_values(new_modifier, opt.force_national_mod());
541 context.
state.
world.reform_option_set_modifier(
id, new_modifier);
557 auto modifier = parse_technology_contents(gen, err, new_context);
559 if(modifier.next_to_add_n != 0 || modifier.next_to_add_p != 0) {
560 auto new_modifier = context.
state.
world.create_modifier();
561 context.
state.
world.modifier_set_name(new_modifier, context.
state.
world.technology_get_name(
id));
562 context.
state.
world.modifier_set_icon(new_modifier,
uint8_t(modifier.icon_index));
563 context.
state.
world.modifier_set_national_values(new_modifier, modifier.force_national_mod());
564 context.
state.
world.technology_set_modifier(
id, new_modifier);
579 auto modifier = parse_invention_contents(gen, err, new_context);
581 if(modifier.next_to_add_n != 0 || modifier.next_to_add_p != 0) {
582 auto new_modifier = context.
state.
world.create_modifier();
583 context.
state.
world.modifier_set_name(new_modifier, context.
state.
world.invention_get_name(
id));
584 context.
state.
world.modifier_set_icon(new_modifier,
uint8_t(modifier.icon_index));
585 context.
state.
world.modifier_set_national_values(new_modifier, modifier.force_national_mod());
586 context.
state.
world.invention_set_modifier(
id, new_modifier);
628 parse_rebel_body(gen, err, new_context);
std::string accumulated_errors
tag_type emplace_back(T &&... ts)
tagged_vector< gfx_object, dcon::gfx_object_id > gfx
tagged_vector< dcon::text_key, dcon::texture_id > textures
void read_pop_ideology(std::string_view name, token_generator &gen, error_handler &err, poptype_context &context)
void register_crime(std::string_view name, token_generator &gen, error_handler &err, scenario_building_context &context)
void make_issues_group(std::string_view name, token_generator &gen, error_handler &err, scenario_building_context &context)
commodity_array stub_commodity_array(token_generator &gen, error_handler &err, poptype_context &context)
void register_technology(std::string_view name, token_generator &gen, error_handler &err, scenario_building_context &context)
void read_pending_rebel_type(dcon::rebel_type_id id, token_generator &gen, error_handler &err, scenario_building_context &context)
void read_pop_issue(std::string_view name, token_generator &gen, error_handler &err, poptype_context &context)
dcon::trigger_key make_inv_limit(token_generator &gen, error_handler &err, invention_context &context)
dcon::trigger_key make_trigger(token_generator &gen, error_handler &err, trigger_building_context &context)
dcon::value_modifier_key make_reb_will_rise(token_generator &gen, error_handler &err, rebel_context &context)
void register_ideology(std::string_view name, token_generator &gen, error_handler &err, ideology_group_context &context)
void read_c_migration_target(token_generator &gen, error_handler &err, poptype_context &context)
dcon::value_modifier_key ideology_condition(token_generator &gen, error_handler &err, individual_ideology_context &context)
void register_invention(std::string_view name, token_generator &gen, error_handler &err, tech_group_context &context)
void read_pending_technology(dcon::technology_id id, token_generator &gen, error_handler &err, scenario_building_context &context)
void make_religion(std::string_view name, token_generator &gen, error_handler &err, scenario_building_context &context)
void make_opt_allow(token_generator &gen, error_handler &err, individual_option_context &context)
dcon::trigger_key make_reb_enforced_trigger(token_generator &gen, error_handler &err, rebel_context &context)
dcon::trigger_key make_reb_s_won_trigger(token_generator &gen, error_handler &err, rebel_context &context)
dcon::effect_key make_reb_s_won_effect(token_generator &gen, error_handler &err, rebel_context &context)
void register_option(std::string_view name, token_generator &gen, error_handler &err, issue_context &context)
dcon::value_modifier_key make_poptype_pop_chance(token_generator &gen, error_handler &err, scenario_building_context &context)
void make_issue(std::string_view name, token_generator &gen, error_handler &err, issue_group_context &context)
void read_pending_reform(dcon::reform_option_id id, token_generator &gen, error_handler &err, scenario_building_context &context)
dcon::value_modifier_key make_ai_chance(token_generator &gen, error_handler &err, tech_context &context)
void read_pending_invention(dcon::invention_id id, token_generator &gen, error_handler &err, scenario_building_context &context)
void read_migration_target(token_generator &gen, error_handler &err, poptype_context &context)
dcon::value_modifier_key make_value_modifier(token_generator &gen, error_handler &err, trigger_building_context &context)
void read_pending_option(dcon::issue_option_id id, token_generator &gen, error_handler &err, scenario_building_context &context)
void make_issue_vote_modifier(std::string_view name, token_generator &gen, error_handler &err, individual_option_context &context)
dcon::value_modifier_key make_reb_movement_eval(token_generator &gen, error_handler &err, rebel_context &context)
void read_pending_crime(dcon::crime_id id, token_generator &gen, error_handler &err, scenario_building_context &context)
bool is_fixed_token_ci(char const *start, char const *end, char const (&t)[N])
void make_ln_list(token_generator &gen, error_handler &err, culture_context &context)
dcon::effect_key make_execute_effect(token_generator &gen, error_handler &err, individual_option_context &context)
void make_tech_folder_list(std::string_view name, token_generator &gen, error_handler &err, scenario_building_context &context)
dcon::trigger_key make_execute_trigger(token_generator &gen, error_handler &err, individual_option_context &context)
dcon::effect_key make_effect(token_generator &gen, error_handler &err, effect_building_context &context)
void make_culture_group(std::string_view name, token_generator &gen, error_handler &err, scenario_building_context &context)
void read_school_modifier(std::string_view name, token_generator &gen, error_handler &err, scenario_building_context &context)
void make_fn_list(token_generator &gen, error_handler &err, culture_context &context)
void read_promotion_target(std::string_view name, token_generator &gen, error_handler &err, poptype_context &context)
dcon::effect_key make_reb_enforce_effect(token_generator &gen, error_handler &err, rebel_context &context)
dcon::value_modifier_key make_reb_spawn_chance(token_generator &gen, error_handler &err, rebel_context &context)
dcon::trigger_key make_party_trigger(token_generator &gen, error_handler &err, party_context &context)
void make_ideology_group(std::string_view name, token_generator &gen, error_handler &err, scenario_building_context &context)
dcon::value_modifier_key make_inv_chance(token_generator &gen, error_handler &err, invention_context &context)
void register_rebel_type(std::string_view name, token_generator &gen, error_handler &err, scenario_building_context &context)
void make_government(std::string_view name, token_generator &gen, error_handler &err, scenario_building_context &context)
dcon::trigger_key make_crime_trigger(token_generator &gen, error_handler &err, scenario_building_context &context)
void make_culture(std::string_view name, token_generator &gen, error_handler &err, culture_group_context &context)
native_string win1250_to_native(std::string_view data_in)
native_string utf8_to_native(std::string_view data_in)
std::string remove_double_backslashes(std::string_view data_in)
dcon::text_key find_or_add_key(sys::state &state, std::string_view key, bool as_unicode)
std::vector< dcon::issue_id > political_issues
std::vector< dcon::reform_id > military_issues
tagged_vector< crime_info, dcon::crime_id > crimes
std::vector< dcon::reform_id > economic_issues
std::vector< dcon::issue_id > party_issues
std::vector< dcon::issue_id > social_issues
ankerl::unordered_dense::map< std::string, dcon::gfx_object_id > map_of_names
ankerl::unordered_dense::map< std::string, dcon::texture_id > map_of_texture_names
dcon::trigger_key trigger
scenario_building_context & outer_context
dcon::culture_group_id id
scenario_building_context & outer_context
scenario_building_context & outer_context
dcon::ideology_group_id id
scenario_building_context & outer_context
scenario_building_context & outer_context
dcon::reform_option_id id
scenario_building_context & outer_context
scenario_building_context & outer_context
scenario_building_context & outer_context
scenario_building_context & outer_context
::culture::issue_category issue_cat
sys::national_modifier_definition const & peek_national_mod() const
sys::provincial_modifier_definition const & peek_province_mod() const
scenario_building_context & outer_context
scenario_building_context & outer_context
scenario_building_context & outer_context
scenario_building_context & outer_context
ankerl::unordered_dense::map< std::string, dcon::culture_group_id > map_of_culture_group_names
ankerl::unordered_dense::map< std::string, dcon::modifier_id > map_of_modifiers
ankerl::unordered_dense::map< std::string, dcon::religion_id > map_of_religion_names
ankerl::unordered_dense::map< std::string, pending_invention_content > map_of_inventions
std::vector< simple_fs::file > tech_and_invention_files
ankerl::unordered_dense::map< std::string, pending_roption_content > map_of_roptions
ankerl::unordered_dense::map< std::string, pending_tech_content > map_of_technologies
ankerl::unordered_dense::map< std::string, dcon::pop_type_id > map_of_poptypes
ankerl::unordered_dense::map< std::string, pending_ideology_content > map_of_ideologies
ankerl::unordered_dense::map< std::string, dcon::reform_id > map_of_reforms
ankerl::unordered_dense::map< std::string, dcon::issue_id > map_of_iissues
ankerl::unordered_dense::map< std::string, pending_crime_content > map_of_crimes
ankerl::unordered_dense::map< std::string, pending_option_content > map_of_ioptions
ankerl::unordered_dense::map< std::string, pending_rebel_type_content > map_of_rebeltypes
building_gfx_context gfx_context
ankerl::unordered_dense::map< std::string, dcon::culture_id > map_of_culture_names
ankerl::unordered_dense::map< std::string, dcon::government_type_id > map_of_governments
ankerl::unordered_dense::map< std::string, dcon::ideology_group_id > map_of_ideology_groups
scenario_building_context & outer_context
::culture::tech_category category
scenario_building_context & outer_context
culture::global_cultural_state culture_definitions
dcon::text_key add_key_win1252(std::string const &text)
dcon::data_container world
std::string_view to_string_view(dcon::text_key tag) const
simple_fs::file_system common_fs
dcon::texture_id primary_texture_handle