9 for(
auto n : army.get_army_membership()) {
10 dcon::unit_type_id utid = n.get_regiment().get_type();
11 auto result =
state.military_definitions.unit_base_definitions[utid].type;
27 for(
auto n : navy.get_navy_membership()) {
28 dcon::unit_type_id utid = n.get_ship().get_type();
29 auto result =
state.military_definitions.unit_base_definitions[utid].type;
47 auto controller = army.get_controller_from_army_control();
49 controller =
dcon::fatten(
state.world,
state.world.national_identity_get_nation_from_identity_holder(
state.national_definitions.rebel_id));
52 float total_cost = 0.f;
53 for(
const auto memb : army.get_army_membership()) {
54 auto type =
state.world.regiment_get_type(memb.get_regiment());
55 auto o_sc_mod = std::max(0.01f,
state.world.nation_get_modifier_values(controller, sys::national_mod_offsets::supply_consumption) + 1.0f);
56 auto& supply_cost =
state.military_definitions.unit_base_definitions[
type].supply_cost;
58 if(supply_cost.commodity_type[i]) {
59 float cost =
state.world.commodity_get_cost(supply_cost.commodity_type[i]);
60 float amount = supply_cost.commodity_amounts[i] *
state.world.nation_get_unit_stats(controller,
type).supply_consumption * o_sc_mod;
61 total_cost += cost * amount;
76 if(army.get_arrival_time()) {
97 auto controller = navy.get_controller_from_navy_control();
99 controller =
dcon::fatten(
state.world,
state.world.national_identity_get_nation_from_identity_holder(
state.national_definitions.rebel_id));
102 float total_cost = 0.f;
103 for(
const auto memb : navy.get_navy_membership()) {
104 auto type =
state.world.ship_get_type(memb.get_ship());
105 auto o_sc_mod = std::max(0.01f,
state.world.nation_get_modifier_values(controller, sys::national_mod_offsets::supply_consumption) + 1.0f);
106 auto& supply_cost =
state.military_definitions.unit_base_definitions[
type].supply_cost;
108 if(supply_cost.commodity_type[i]) {
109 float cost =
state.world.commodity_get_cost(supply_cost.commodity_type[i]);
110 float amount = supply_cost.commodity_amounts[i] *
state.world.nation_get_unit_stats(controller,
type).supply_consumption * o_sc_mod;
111 total_cost += cost * amount;
126 if(navy.get_arrival_time()) {
145 for(
auto armyloc : fat.get_army_location()) {
146 auto army = armyloc.get_army();
153 for(
auto navyloc : fat.get_navy_location()) {
154 auto navy = navyloc.get_navy();
float estimate_army_offensive_strength(sys::state &state, dcon::army_id a)
float estimate_army_defensive_strength(sys::state &state, dcon::army_id a)
pop_satisfaction_wrapper_fat fatten(data_container const &c, pop_satisfaction_wrapper_id id) noexcept
void add_to_layout_box(sys::state &state, layout_base &dest, layout_box &box, embedded_flag ico)
std::string resolve_string_substitution(sys::state &state, dcon::text_key source_text, substitution_map const &mp)
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 add_to_substitution_map(substitution_map &mp, variable_type key, substitution value)
ankerl::unordered_dense::map< uint32_t, substitution > substitution_map
void close_layout_box(columnar_layout &dest, layout_box &box)
unitamounts calc_amounts_from_navy(sys::state &state, dcon::navy_fat_id navy)
void populate_navies(sys::state &state, text::columnar_layout &contents, dcon::province_id prov)
unitamounts calc_amounts_from_army(sys::state &state, dcon::army_fat_id army)
void populate_unit_tooltip(sys::state &state, text::columnar_layout &contents, dcon::province_id prov)
void populate_armies(sys::state &state, text::columnar_layout &contents, dcon::province_id prov)
void single_unit_tooltip(sys::state &state, text::columnar_layout &contents, dcon::army_id a)
static constexpr uint32_t set_size