From 170ee25469322d25931050813a779dfbc2eaa4b0 Mon Sep 17 00:00:00 2001 From: Hop311 Date: Thu, 10 Aug 2023 11:32:53 +0100 Subject: Added distributions for pop type and culture --- src/openvic/pop/Culture.cpp | 3 +-- src/openvic/pop/Culture.hpp | 2 +- src/openvic/pop/Pop.cpp | 7 +++---- src/openvic/pop/Pop.hpp | 2 +- src/openvic/pop/Religion.cpp | 3 +-- src/openvic/pop/Religion.hpp | 2 +- 6 files changed, 8 insertions(+), 11 deletions(-) (limited to 'src/openvic/pop') diff --git a/src/openvic/pop/Culture.cpp b/src/openvic/pop/Culture.cpp index 8f72f20..b683804 100644 --- a/src/openvic/pop/Culture.cpp +++ b/src/openvic/pop/Culture.cpp @@ -18,8 +18,7 @@ GraphicalCultureType const& CultureGroup::get_unit_graphical_culture_type() cons Culture::Culture(CultureGroup const& new_group, std::string const& new_identifier, colour_t new_colour, name_list_t const& new_first_names, name_list_t const& new_last_names) : group { new_group }, - HasIdentifier { new_identifier }, - HasColour { new_colour, true }, + HasIdentifierAndColour { new_identifier, new_colour, true }, first_names { new_first_names }, last_names { new_last_names } { } diff --git a/src/openvic/pop/Culture.hpp b/src/openvic/pop/Culture.hpp index 971ef71..657a531 100644 --- a/src/openvic/pop/Culture.hpp +++ b/src/openvic/pop/Culture.hpp @@ -32,7 +32,7 @@ namespace OpenVic { GraphicalCultureType const& get_unit_graphical_culture_type() const; }; - struct Culture : HasIdentifier, HasColour { + struct Culture : HasIdentifierAndColour { friend struct CultureManager; using name_list_t = std::vector; diff --git a/src/openvic/pop/Pop.cpp b/src/openvic/pop/Pop.cpp index babcd25..913d31f 100644 --- a/src/openvic/pop/Pop.cpp +++ b/src/openvic/pop/Pop.cpp @@ -35,8 +35,7 @@ PopType::PopType(std::string const& new_identifier, colour_t new_colour, strata_t new_strata, sprite_t new_sprite, 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) - : HasIdentifier { new_identifier }, - HasColour { new_colour, true }, + : HasIdentifierAndColour { new_identifier, new_colour, true }, strata { new_strata }, sprite { new_sprite }, max_size { new_max_size }, @@ -141,8 +140,8 @@ void PopManager::generate_test_pops(Province& province) const { static PopType const& type_rich = *get_pop_type_by_identifier("test_pop_type_rich"); static Culture const& culture = *culture_manager.get_culture_by_identifier("test_culture"); static Religion const& religion = *religion_manager.get_religion_by_identifier("test_religion"); - province.add_pop({ type_poor, culture, religion, static_cast(province.get_index() * province.get_index() * province.get_index()) * 1000 }); - province.add_pop({ type_middle, culture, religion, static_cast(province.get_index() * province.get_index()) * 1000 }); + province.add_pop({ type_poor, culture, religion, static_cast(province.get_index() * province.get_index()) * 100 }); + province.add_pop({ type_middle, culture, religion, static_cast(province.get_index() * province.get_index()) * 50 }); province.add_pop({ type_rich, culture, religion, static_cast(province.get_index()) * 1000 }); } else { Logger::error("Cannot generate pops before pop types registry is locked!"); diff --git a/src/openvic/pop/Pop.hpp b/src/openvic/pop/Pop.hpp index 626cd8c..628194d 100644 --- a/src/openvic/pop/Pop.hpp +++ b/src/openvic/pop/Pop.hpp @@ -40,7 +40,7 @@ namespace OpenVic { /* REQUIREMENTS: * POP-26 */ - struct PopType : HasIdentifier, HasColour { + struct PopType : HasIdentifierAndColour { friend struct PopManager; using sprite_t = uint8_t; diff --git a/src/openvic/pop/Religion.cpp b/src/openvic/pop/Religion.cpp index a5b2abb..f3d3341 100644 --- a/src/openvic/pop/Religion.cpp +++ b/src/openvic/pop/Religion.cpp @@ -9,8 +9,7 @@ ReligionGroup::ReligionGroup(std::string const& new_identifier) : HasIdentifier Religion::Religion(ReligionGroup const& new_group, std::string const& new_identifier, colour_t new_colour, icon_t new_icon, bool new_pagan) : group { new_group }, - HasIdentifier { new_identifier }, - HasColour { new_colour, true }, + HasIdentifierAndColour { new_identifier, new_colour, true }, icon { new_icon }, pagan { new_pagan } { assert(icon > 0); diff --git a/src/openvic/pop/Religion.hpp b/src/openvic/pop/Religion.hpp index 2a67ce3..e781cf9 100644 --- a/src/openvic/pop/Religion.hpp +++ b/src/openvic/pop/Religion.hpp @@ -16,7 +16,7 @@ namespace OpenVic { ReligionGroup(ReligionGroup&&) = default; }; - struct Religion : HasIdentifier, HasColour { + struct Religion : HasIdentifierAndColour { friend struct ReligionManager; using icon_t = uint8_t; -- cgit v1.2.3-56-ga3b1