11 existing_it->second.generator_state = gen;
12 return existing_it->second.id;
14 auto new_id = context.
state.
world.create_cb_type();
20 auto name_desc = std::string(name) +
"_desc";
21 auto name_setup = std::string(name) +
"_setup";
22 auto name_cond = std::string(name) +
"_short";
23 context.
state.
world.cb_type_set_name(
id, name_id);
27 context.
state.
world.cb_type_set_construction_speed(
id, 1.0f);
30 if(
is_fixed_token_ci(name.data(), name.data() + name.length(),
"uninstall_communist_gov_cb"))
32 else if(
is_fixed_token_ci(name.data(), name.data() + name.length(),
"liberate_country"))
34 else if(
is_fixed_token_ci(name.data(), name.data() + name.length(),
"status_quo"))
37 context.
state.
world.cb_type_set_type_bits(
id, special_flags);
44 dcon::leader_trait_id new_id = context.
state.
world.create_leader_trait();
47 context.
state.
world.leader_trait_set_name(new_id, name_id);
51 parse_trait(gen, err, new_context);
54 parse_traits_set(gen, err, context);
58 dcon::leader_trait_id(dcon::leader_trait_id::value_base_t(context.
state.
world.leader_trait_size()));
59 parse_traits_set(gen, err, context);
64 dcon::unit_type_id army_base_id =
72 context.
map_of_unit_types.insert_or_assign(std::string(
"army_base"), army_base_id);
76 dcon::unit_type_id navy_base_id =
84 context.
map_of_unit_types.insert_or_assign(std::string(
"navy_base"), navy_base_id);
90 dcon::unit_type_id new_id =
101 if(name ==
"infantry") {
166 parse_oob_army(gen, err, new_context);
171 if(!
bool(m.get_regiment().get_type())) {
181 parse_oob_navy(gen, err, new_context);
186 if(!
bool(m.get_ship().get_type())) {
198 parse_oob_regiment(gen, err, new_context);
209 parse_oob_ship(gen, err, new_context);
216 return parse_oob_leader(gen, err, new_context);
220 return parse_oob_leader(gen, err, new_context);
std::string accumulated_errors
std::string accumulated_warnings
dcon::trigger_key cb_allowed_substates(token_generator &gen, error_handler &err, individual_cb_context &context)
void personality_traits_set(token_generator &gen, error_handler &err, scenario_building_context &context)
dcon::effect_key cb_on_add(token_generator &gen, error_handler &err, individual_cb_context &context)
dcon::trigger_key make_trigger(token_generator &gen, error_handler &err, trigger_building_context &context)
dcon::effect_key cb_on_po_accepted(token_generator &gen, error_handler &err, individual_cb_context &context)
dcon::trigger_key cb_allowed_states(token_generator &gen, error_handler &err, individual_cb_context &context)
oob_leader make_army_leader(token_generator &gen, error_handler &err, oob_file_army_context &context)
void make_oob_ship(token_generator &gen, error_handler &err, oob_file_navy_context &context)
oob_leader make_navy_leader(token_generator &gen, error_handler &err, oob_file_navy_context &context)
dcon::trigger_key cb_can_use(token_generator &gen, error_handler &err, individual_cb_context &context)
void make_oob_navy(token_generator &gen, error_handler &err, oob_file_context &context)
void make_trait(std::string_view name, token_generator &gen, error_handler &err, scenario_building_context &context)
void make_oob_regiment(token_generator &gen, error_handler &err, oob_file_army_context &context)
void make_oob_army(token_generator &gen, error_handler &err, oob_file_context &context)
void background_traits_set(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 register_cb_type(std::string_view name, token_generator &gen, error_handler &err, scenario_building_context &context)
dcon::effect_key make_effect(token_generator &gen, error_handler &err, effect_building_context &context)
dcon::trigger_key cb_allowed_countries(token_generator &gen, error_handler &err, individual_cb_context &context)
void make_unit(std::string_view name, token_generator &gen, error_handler &err, scenario_building_context &context)
dcon::trigger_key cb_allowed_crisis_states(token_generator &gen, error_handler &err, individual_cb_context &context)
void make_base_units(scenario_building_context &context)
std::string produce_simple_string(sys::state const &state, dcon::text_key id)
dcon::text_key find_or_add_key(sys::state &state, std::string_view key, bool as_unicode)
dcon::cb_type_id uninstall_communist_gov
dcon::unit_type_id base_army_unit
dcon::unit_type_id irregular
tagged_vector< unit_definition, dcon::unit_type_id > unit_base_definitions
dcon::unit_type_id infantry
dcon::cb_type_id standard_status_quo
dcon::cb_type_id liberate
dcon::unit_type_id base_naval_unit
dcon::unit_type_id artillery
dcon::leader_trait_id first_background_trait
scenario_building_context & outer_context
scenario_building_context & outer_context
dcon::nation_id nation_for
scenario_building_context & outer_context
dcon::nation_id nation_for
scenario_building_context & outer_context
dcon::nation_id nation_for
ankerl::unordered_dense::map< std::string, dcon::unit_type_id > map_of_unit_types
ankerl::unordered_dense::map< std::string, dcon::leader_trait_id > map_of_leader_traits
ankerl::unordered_dense::map< std::string, pending_cb_content > map_of_cb_types
dcon::data_container world
military::global_military_state military_definitions