diff options
author | Hop311 <Hop3114@gmail.com> | 2023-11-07 22:38:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-07 22:38:07 +0100 |
commit | ae2742113ec7283a2a5afa62f8bfd98a865c4208 (patch) | |
tree | 601591215af0c6724766019ebb577141ea5807c5 /src/openvic-simulation/pop | |
parent | 1603fbafb1c03830f38fefd87d8bd0d7d3f135a2 (diff) | |
parent | d30421fa7d7f6ad87d3f90cc0ab491742f0d2548 (diff) |
Merge pull request #64 from OpenVicProject/modifier-instance
ModifierEffects stored as instances
Diffstat (limited to 'src/openvic-simulation/pop')
-rw-r--r-- | src/openvic-simulation/pop/Culture.cpp | 6 | ||||
-rw-r--r-- | src/openvic-simulation/pop/Pop.cpp | 2 | ||||
-rw-r--r-- | src/openvic-simulation/pop/Religion.cpp | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/openvic-simulation/pop/Culture.cpp b/src/openvic-simulation/pop/Culture.cpp index e386930..47501e0 100644 --- a/src/openvic-simulation/pop/Culture.cpp +++ b/src/openvic-simulation/pop/Culture.cpp @@ -28,7 +28,7 @@ bool CultureGroup::get_is_overseas() const { Culture::Culture( std::string_view new_identifier, colour_t new_colour, CultureGroup const& new_group, std::vector<std::string>&& new_first_names, std::vector<std::string>&& new_last_names -) : HasIdentifierAndColour { new_identifier, new_colour, true, false }, group { new_group }, +) : HasIdentifierAndColour { new_identifier, new_colour, false, false }, group { new_group }, first_names { std::move(new_first_names) }, last_names { std::move(new_last_names) } {} CultureGroup const& Culture::get_group() const { @@ -174,7 +174,7 @@ bool CultureManager::load_culture_file(ast::NodeCPtr root) { return false; } - static const std::string default_unit_graphical_culture_type_identifier = "Generic"; + static constexpr std::string_view default_unit_graphical_culture_type_identifier = "Generic"; GraphicalCultureType const* const default_unit_graphical_culture_type = get_graphical_culture_type_by_identifier(default_unit_graphical_culture_type_identifier); if (default_unit_graphical_culture_type == nullptr) { @@ -195,7 +195,7 @@ bool CultureManager::load_culture_file(ast::NodeCPtr root) { CultureGroup const* culture_group = get_culture_group_by_identifier(culture_group_key); return expect_dictionary([this, culture_group](std::string_view key, ast::NodeCPtr value) -> bool { static const string_set_t reserved_keys = { "leader", "unit", "union", "is_overseas" }; - if (reserved_keys.find(key) != reserved_keys.end()) { + if (reserved_keys.contains(key)) { return true; } return _load_culture(culture_group, key, value); diff --git a/src/openvic-simulation/pop/Pop.cpp b/src/openvic-simulation/pop/Pop.cpp index f63a704..0b61096 100644 --- a/src/openvic-simulation/pop/Pop.cpp +++ b/src/openvic-simulation/pop/Pop.cpp @@ -52,7 +52,7 @@ PopType::PopType( Good::good_map_t&& new_life_needs, Good::good_map_t&& new_everyday_needs, Good::good_map_t&& new_luxury_needs, rebel_units_t&& new_rebel_units, Pop::pop_size_t new_max_size, Pop::pop_size_t new_merge_max_size, bool new_state_capital_only, bool new_demote_migrant, bool new_is_artisan, bool new_is_slave -) : HasIdentifierAndColour { new_identifier, new_colour, true, false }, strata { new_strata }, sprite { new_sprite }, +) : HasIdentifierAndColour { new_identifier, new_colour, false, false }, strata { new_strata }, sprite { new_sprite }, life_needs { std::move(new_life_needs) }, everyday_needs { std::move(new_everyday_needs) }, luxury_needs { std::move(new_luxury_needs) }, rebel_units { std::move(new_rebel_units) }, max_size { new_max_size }, merge_max_size { new_merge_max_size }, state_capital_only { new_state_capital_only }, diff --git a/src/openvic-simulation/pop/Religion.cpp b/src/openvic-simulation/pop/Religion.cpp index 489984d..99915c3 100644 --- a/src/openvic-simulation/pop/Religion.cpp +++ b/src/openvic-simulation/pop/Religion.cpp @@ -9,7 +9,7 @@ ReligionGroup::ReligionGroup(std::string_view new_identifier) : HasIdentifier { Religion::Religion( std::string_view new_identifier, colour_t new_colour, ReligionGroup const& new_group, icon_t new_icon, bool new_pagan -) : HasIdentifierAndColour { new_identifier, new_colour, true, false }, group { new_group }, icon { new_icon }, +) : HasIdentifierAndColour { new_identifier, new_colour, false, false }, group { new_group }, icon { new_icon }, pagan { new_pagan } { assert(icon > 0); } |