6 auto iid = fatten(
state.world, inv_id);
11 if(iid.get_enable_gas_attack()) {
14 if(iid.get_enable_gas_defense()) {
19 auto increase_building = iid.get_increase_building(t);
20 if(increase_building) {
32 if(
auto p = iid.get_shared_prestige(); p > 0) {
34 for(
auto n :
state.world.in_nation) {
35 if(n.get_active_inventions(iid)) {
48 if(iid.get_plurality() != 0) {
52 if(iid.get_plurality() < 0) {
61 auto activate_unit_description = [&](dcon::unit_type_id id) {
62 if(iid.get_activate_unit(
id)) {
63 auto unit_type_name =
state.military_definitions.unit_base_definitions[id].name;
73 for(
uint8_t unit_type_i = 0; unit_type_i < iid.get_activate_unit_size(); ++unit_type_i) {
74 dcon::unit_type_id id(unit_type_i);
75 activate_unit_description(
id);
78 auto activate_factory_description = [&](dcon::factory_type_id id) {
79 if(iid.get_activate_building(
id)) {
99 for(
uint8_t building_type_i = 0; building_type_i < iid.get_activate_building_size(); ++building_type_i) {
100 dcon::factory_type_id id(building_type_i);
101 activate_factory_description(
id);
104 for(
auto i =
state.culture_definitions.crimes.size(); i-- > 0;) {
105 dcon::crime_id c{dcon::crime_id::value_base_t(i)};
106 if(iid.get_activate_crime(c)) {
113 auto commodity_mod_description = [&](
auto const& list, std::string_view locale_base_name, std::string_view locale_farm_base_name) {
114 for(
const auto mod : list) {
116 auto name =
state.world.commodity_get_name(mod.type);
127 commodity_mod_description(iid.get_factory_goods_output(),
"tech_output",
"tech_output");
128 commodity_mod_description(iid.get_rgo_goods_output(),
"tech_mine_output",
"tech_farm_output");
129 commodity_mod_description(iid.get_factory_goods_throughput(),
"tech_throughput",
"tech_throughput");
130 commodity_mod_description(iid.get_rgo_size(),
"tech_mine_size",
"tech_farm_size");
132 auto colonial_points = iid.get_colonial_points();
133 if(colonial_points != 0) {
147 if(mod.type ==
state.military_definitions.base_army_unit) {
149 }
else if(mod.type ==
state.military_definitions.base_naval_unit) {
156 is_land =
state.military_definitions.unit_base_definitions[mod.type].is_land;
159 if(mod.build_time != 0) {
163 if(mod.build_time < 0) {
171 if(mod.default_organisation != 0) {
175 if(mod.default_organisation < 0) {
183 if(mod.maximum_speed != 0) {
187 if(mod.maximum_speed < 0) {
195 if(mod.supply_consumption != 0) {
199 if(mod.supply_consumption < 0) {
209 if(mod.attack_or_gun_power != 0) {
213 if(mod.attack_or_gun_power < 0) {
221 if(mod.defence_or_hull != 0) {
225 if(mod.defence_or_hull < 0) {
233 if(mod.reconnaissance_or_fire_range != 0) {
237 if(mod.reconnaissance_or_fire_range < 0) {
247 if(mod.siege_or_torpedo_attack != 0) {
251 if(mod.siege_or_torpedo_attack < 0) {
260 if(mod.support != 0) {
264 if(mod.support < 0) {
272 if(mod.discipline_or_evasion != 0) {
276 if(mod.discipline_or_evasion < 0) {
285 if(mod.attack_or_gun_power != 0) {
289 if(mod.attack_or_gun_power < 0) {
297 if(mod.defence_or_hull != 0) {
301 if(mod.defence_or_hull < 0) {
309 if(mod.reconnaissance_or_fire_range != 0) {
313 if(mod.reconnaissance_or_fire_range < 0) {
323 if(mod.siege_or_torpedo_attack != 0) {
327 if(mod.siege_or_torpedo_attack < 0) {
336 if(mod.discipline_or_evasion != 0) {
340 if(mod.discipline_or_evasion < 0) {
350 for(
auto& mod : iid.get_modified_units()) {
351 unit_modifier_description(mod);
354 for(
auto& mod : iid.get_rebel_org()) {
385 auto mod_id = tech_fat_id.get_modifier().id;
390 auto increase_building = tech_fat_id.get_increase_building(t);
391 if(increase_building) {
402 if(tech_fat_id.get_plurality() != 0) {
406 if(tech_fat_id.get_plurality() < 0) {
414 auto activate_unit_description = [&](dcon::unit_type_id id) {
415 if(tech_fat_id.get_activate_unit(
id)) {
416 auto unit_type_name =
state.military_definitions.unit_base_definitions[id].name;
426 for(
uint8_t unit_type_i = 0; unit_type_i < tech_fat_id.get_activate_unit_size(); ++unit_type_i) {
427 dcon::unit_type_id id(unit_type_i);
428 activate_unit_description(
id);
431 auto activate_factory_description = [&](dcon::factory_type_id id) {
432 if(tech_fat_id.get_activate_building(
id)) {
452 for(
uint8_t building_type_i = 0; building_type_i < tech_fat_id.get_activate_building_size(); ++building_type_i) {
453 dcon::factory_type_id id(building_type_i);
454 activate_factory_description(
id);
457 auto commodity_mod_description = [&](
auto const& list, std::string_view locale_base_name,
458 std::string_view locale_farm_base_name) {
459 for(
const auto mod : list) {
461 auto name =
state.world.commodity_get_name(mod.type);
473 commodity_mod_description(tech_fat_id.get_factory_goods_output(),
"tech_output",
"tech_output");
474 commodity_mod_description(tech_fat_id.get_rgo_goods_output(),
"tech_mine_output",
"tech_farm_output");
475 commodity_mod_description(tech_fat_id.get_rgo_size(),
"tech_mine_size",
"tech_farm_size");
477 auto colonial_points = tech_fat_id.get_colonial_points();
478 if(colonial_points != 0) {
492 if(mod.type ==
state.military_definitions.base_army_unit) {
494 }
else if(mod.type ==
state.military_definitions.base_naval_unit) {
501 is_land =
state.military_definitions.unit_base_definitions[mod.type].is_land;
504 if(mod.build_time != 0) {
508 if(mod.build_time < 0) {
516 if(mod.default_organisation != 0) {
520 if(mod.default_organisation < 0) {
528 if(mod.maximum_speed != 0) {
532 if(mod.maximum_speed < 0) {
540 if(mod.supply_consumption != 0) {
544 if(mod.supply_consumption < 0) {
554 if(mod.attack_or_gun_power != 0) {
558 if(mod.attack_or_gun_power < 0) {
566 if(mod.defence_or_hull != 0) {
570 if(mod.defence_or_hull < 0) {
578 if(mod.reconnaissance_or_fire_range != 0) {
582 if(mod.reconnaissance_or_fire_range < 0) {
592 if(mod.siege_or_torpedo_attack != 0) {
596 if(mod.siege_or_torpedo_attack < 0) {
605 if(mod.support != 0) {
609 if(mod.support < 0) {
618 if(mod.attack_or_gun_power != 0) {
622 if(mod.attack_or_gun_power < 0) {
630 if(mod.defence_or_hull != 0) {
634 if(mod.defence_or_hull < 0) {
642 if(mod.reconnaissance_or_fire_range != 0) {
646 if(mod.reconnaissance_or_fire_range < 0) {
656 if(mod.siege_or_torpedo_attack != 0) {
660 if(mod.siege_or_torpedo_attack < 0) {
672 for(
auto& mod : tech_fat_id.get_modified_units()) {
673 unit_modifier_description(mod);
676 bool an_invention =
false;
678 state.world.for_each_invention([&](dcon::invention_id
id) {
679 auto lim_trigger_k =
state.world.invention_get_limit(
id);
680 bool activable_by_this_tech =
false;
682 [&](uint16_t* tval) {
683 if((tval[0] & trigger::code_mask) == trigger::technology && trigger::payload(tval[1]).tech_id == tech_id)
684 activable_by_this_tech = true;
686 if(activable_by_this_tech) {
704 return parent && parent->parent &&
static_cast<technology_window*
>(parent->parent)->active_tab == category;
710 parent->parent->impl_set(
state, payload);
715 if(payload.holds_type<dcon::technology_id>()) {
716 tech_id = any_cast<dcon::technology_id>(payload);
718 category =
state.culture_definitions.tech_folders[tech.get_folder_index()].category;
721 auto enum_val = any_cast<culture::tech_category>(payload);
722 set_visible(
state, category == enum_val);
message_result set(sys::state &state, Cyto::Any &payload) noexcept override
pop_satisfaction_wrapper_fat fatten(data_container const &c, pop_satisfaction_wrapper_id id) noexcept
std::string_view province_building_type_get_name(economy::province_building_type v)
void add_line_break_to_layout_box(sys::state &state, layout_base &dest, layout_box &box)
void add_to_layout_box(sys::state &state, layout_base &dest, layout_box &box, embedded_flag ico)
layout_box open_layout_box(layout_base &dest, int32_t indent)
void localised_format_box(sys::state &state, layout_base &dest, layout_box &box, std::string_view key, text::substitution_map const &sub)
std::string prettify(int64_t num)
void add_line(sys::state &state, layout_base &dest, dcon::text_key txt, int32_t indent)
std::string produce_simple_string(sys::state const &state, dcon::text_key id)
std::string format_percentage(float num, size_t digits)
void add_space_to_layout_box(sys::state &state, layout_base &dest, layout_box &box)
void close_layout_box(columnar_layout &dest, layout_box &box)
uint16_t * recurse_over_triggers(uint16_t *source, T const &f)
void modifier_description(sys::state &state, text::layout_base &layout, dcon::modifier_id mid, int32_t indentation=0)
void technology_description(sys::state &state, text::layout_base &contents, dcon::technology_id tech_id) noexcept
void invention_description(sys::state &state, text::layout_base &contents, dcon::invention_id inv_id, int32_t indent) noexcept