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);
119 std::string padding = cid.index() < 10 ?
"0" :
"";
120 std::string description =
"@$" + padding + std::to_string(cid.index());
133 commodity_mod_description(iid.get_factory_goods_output(),
"tech_output",
"tech_output");
134 commodity_mod_description(iid.get_rgo_goods_output(),
"tech_mine_output",
"tech_farm_output");
135 commodity_mod_description(iid.get_factory_goods_throughput(),
"tech_throughput",
"tech_throughput");
136 commodity_mod_description(iid.get_rgo_size(),
"tech_mine_size",
"tech_farm_size");
138 auto colonial_points = iid.get_colonial_points();
139 if(colonial_points != 0) {
153 if(mod.type ==
state.military_definitions.base_army_unit) {
155 }
else if(mod.type ==
state.military_definitions.base_naval_unit) {
162 is_land =
state.military_definitions.unit_base_definitions[mod.type].is_land;
165 if(mod.build_time != 0) {
169 if(mod.build_time < 0) {
177 if(mod.default_organisation != 0) {
181 if(mod.default_organisation < 0) {
189 if(mod.maximum_speed != 0) {
193 if(mod.maximum_speed < 0) {
201 if(mod.supply_consumption != 0) {
205 if(mod.supply_consumption < 0) {
215 if(mod.attack_or_gun_power != 0) {
219 if(mod.attack_or_gun_power < 0) {
227 if(mod.defence_or_hull != 0) {
231 if(mod.defence_or_hull < 0) {
239 if(mod.reconnaissance_or_fire_range != 0) {
243 if(mod.reconnaissance_or_fire_range < 0) {
253 if(mod.siege_or_torpedo_attack != 0) {
257 if(mod.siege_or_torpedo_attack < 0) {
266 if(mod.support != 0) {
270 if(mod.support < 0) {
278 if(mod.discipline_or_evasion != 0) {
282 if(mod.discipline_or_evasion < 0) {
291 if(mod.attack_or_gun_power != 0) {
295 if(mod.attack_or_gun_power < 0) {
303 if(mod.defence_or_hull != 0) {
307 if(mod.defence_or_hull < 0) {
315 if(mod.reconnaissance_or_fire_range != 0) {
319 if(mod.reconnaissance_or_fire_range < 0) {
329 if(mod.siege_or_torpedo_attack != 0) {
333 if(mod.siege_or_torpedo_attack < 0) {
342 if(mod.discipline_or_evasion != 0) {
346 if(mod.discipline_or_evasion < 0) {
356 for(
auto& mod : iid.get_modified_units()) {
357 unit_modifier_description(mod);
360 for(
auto& mod : iid.get_rebel_org()) {
391 auto mod_id = tech_fat_id.get_modifier().id;
396 auto increase_building = tech_fat_id.get_increase_building(t);
397 if(increase_building) {
408 if(tech_fat_id.get_plurality() != 0) {
412 if(tech_fat_id.get_plurality() < 0) {
420 auto activate_unit_description = [&](dcon::unit_type_id id) {
421 if(tech_fat_id.get_activate_unit(
id)) {
422 auto unit_type_name =
state.military_definitions.unit_base_definitions[id].name;
432 for(
uint8_t unit_type_i = 0; unit_type_i < tech_fat_id.get_activate_unit_size(); ++unit_type_i) {
433 dcon::unit_type_id id(unit_type_i);
434 activate_unit_description(
id);
437 auto activate_factory_description = [&](dcon::factory_type_id id) {
438 if(tech_fat_id.get_activate_building(
id)) {
458 for(
uint8_t building_type_i = 0; building_type_i < tech_fat_id.get_activate_building_size(); ++building_type_i) {
459 dcon::factory_type_id id(building_type_i);
460 activate_factory_description(
id);
463 auto commodity_mod_description = [&](
auto const&
list, std::string_view locale_base_name,
464 std::string_view locale_farm_base_name) {
465 for(
const auto mod :
list) {
467 auto name =
state.world.commodity_get_name(mod.type);
470 std::string padding = cid.index() < 10 ?
"0" :
"";
471 std::string description =
"@$" + padding + std::to_string(cid.index());
485 commodity_mod_description(tech_fat_id.get_factory_goods_output(),
"tech_output",
"tech_output");
486 commodity_mod_description(tech_fat_id.get_rgo_goods_output(),
"tech_mine_output",
"tech_farm_output");
487 commodity_mod_description(tech_fat_id.get_rgo_size(),
"tech_mine_size",
"tech_farm_size");
489 auto colonial_points = tech_fat_id.get_colonial_points();
490 if(colonial_points != 0) {
504 if(mod.type ==
state.military_definitions.base_army_unit) {
506 }
else if(mod.type ==
state.military_definitions.base_naval_unit) {
513 is_land =
state.military_definitions.unit_base_definitions[mod.type].is_land;
516 if(mod.build_time != 0) {
520 if(mod.build_time < 0) {
528 if(mod.default_organisation != 0) {
532 if(mod.default_organisation < 0) {
540 if(mod.maximum_speed != 0) {
544 if(mod.maximum_speed < 0) {
552 if(mod.supply_consumption != 0) {
556 if(mod.supply_consumption < 0) {
566 if(mod.attack_or_gun_power != 0) {
570 if(mod.attack_or_gun_power < 0) {
578 if(mod.defence_or_hull != 0) {
582 if(mod.defence_or_hull < 0) {
590 if(mod.reconnaissance_or_fire_range != 0) {
594 if(mod.reconnaissance_or_fire_range < 0) {
604 if(mod.siege_or_torpedo_attack != 0) {
608 if(mod.siege_or_torpedo_attack < 0) {
617 if(mod.support != 0) {
621 if(mod.support < 0) {
630 if(mod.attack_or_gun_power != 0) {
634 if(mod.attack_or_gun_power < 0) {
642 if(mod.defence_or_hull != 0) {
646 if(mod.defence_or_hull < 0) {
654 if(mod.reconnaissance_or_fire_range != 0) {
658 if(mod.reconnaissance_or_fire_range < 0) {
668 if(mod.siege_or_torpedo_attack != 0) {
672 if(mod.siege_or_torpedo_attack < 0) {
684 for(
auto& mod : tech_fat_id.get_modified_units()) {
685 unit_modifier_description(mod);
688 bool an_invention =
false;
690 state.world.for_each_invention([&](dcon::invention_id
id) {
691 auto lim_trigger_k =
state.world.invention_get_limit(
id);
692 bool activable_by_this_tech =
false;
694 [&](uint16_t* tval) {
695 if((tval[0] & trigger::code_mask) == trigger::technology && trigger::payload(tval[1]).tech_id == tech_id)
696 activable_by_this_tech = true;
698 if(activable_by_this_tech) {
716 return parent && parent->parent &&
static_cast<technology_window*
>(parent->parent)->active_tab == category;
722 parent->parent->impl_set(
state, payload);
727 if(payload.holds_type<dcon::technology_id>()) {
728 tech_id = any_cast<dcon::technology_id>(payload);
730 category =
state.culture_definitions.tech_folders[tech.get_folder_index()].category;
733 auto enum_val = any_cast<culture::tech_category>(payload);
734 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 add_unparsed_text_to_layout_box(sys::state &state, layout_base &dest, layout_box &box, std::string_view sv, substitution_map const &mp)
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
Holds important data about the game world, state, and other data regarding windowing,...