Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/openvic-simulation/country/CountryInstanceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ CountryInstanceManager::CountryInstanceManager(
}
{
assert(new_country_definition_manager.country_definitions_are_locked());
great_powers.reserve(16);
secondary_powers.reserve(16);
great_powers.reserve(new_country_defines.get_great_power_rank());
secondary_powers.reserve(new_country_defines.get_max_secondary_power_count());
}

void CountryInstanceManager::update_rankings(const Date today) {
Expand Down
9 changes: 9 additions & 0 deletions src/openvic-simulation/defines/CountryDefines.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include <cstddef>
Comment thread
wvpm marked this conversation as resolved.

#include "openvic-simulation/dataloader/NodeTools.hpp"
#include "openvic-simulation/types/Date.hpp"
#include "openvic-simulation/types/fixed_point/FixedPoint.hpp"
Expand Down Expand Up @@ -39,6 +41,13 @@ namespace OpenVic {
Timespan PROPERTY(campaign_event_state_duration_modifier); // NOT USED
Timespan PROPERTY(campaign_duration);
size_t PROPERTY(secondary_power_rank, 0);

public:
constexpr size_t get_max_secondary_power_count() const {
return secondary_power_rank - great_power_rank;
}

private:
Comment thread
wvpm marked this conversation as resolved.
fixed_point_t PROPERTY(colony_to_state_prestige_gain);
life_rating_t PROPERTY(colonial_liferating, life_rating_t { 0 });
fixed_point_t PROPERTY(base_greatpower_daily_influence);
Expand Down