aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/country
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-04-19 20:28:30 +0200
committer hop311 <hop3114@gmail.com>2024-04-19 20:28:30 +0200
commit4284b73b82c02fb5d2d86fbfd966c03caab8dce4 (patch)
tree2e855a0b277f30ea645f88b5107e4253f24ce948 /src/openvic-simulation/country
parent4dca4f6538a3f82746ca4d8b3e66cdb6f9d0dff6 (diff)
Menu reqs: country index, flag type set, province set total populationmenu-reqs
Diffstat (limited to 'src/openvic-simulation/country')
-rw-r--r--src/openvic-simulation/country/Country.cpp9
-rw-r--r--src/openvic-simulation/country/Country.hpp7
2 files changed, 9 insertions, 7 deletions
diff --git a/src/openvic-simulation/country/Country.cpp b/src/openvic-simulation/country/Country.cpp
index 0fdeb60..447f2dc 100644
--- a/src/openvic-simulation/country/Country.cpp
+++ b/src/openvic-simulation/country/Country.cpp
@@ -26,6 +26,7 @@ CountryParty::CountryParty(
Country::Country(
std::string_view new_identifier,
colour_t new_colour,
+ size_t new_index,
GraphicalCultureType const& new_graphical_culture,
IdentifierRegistry<CountryParty>&& new_parties,
unit_names_map_t&& new_unit_names,
@@ -34,8 +35,8 @@ Country::Country(
colour_t new_primary_unit_colour,
colour_t new_secondary_unit_colour,
colour_t new_tertiary_unit_colour
-) : HasIdentifierAndColour {
- new_identifier, new_colour, false },
+) : HasIdentifierAndColour { new_identifier, new_colour, false },
+ index { new_index },
graphical_culture { new_graphical_culture },
parties { std::move(new_parties) },
unit_names { std::move(new_unit_names) },
@@ -68,8 +69,8 @@ bool CountryManager::add_country(
static constexpr colour_t default_colour = colour_t::fill_as(colour_t::max_value);
return countries.add_item({
- identifier, colour, *graphical_culture, std::move(parties), std::move(unit_names), dynamic_tag,
- std::move(alternative_colours),
+ identifier, colour, countries.size(), *graphical_culture, std::move(parties), std::move(unit_names),
+ dynamic_tag, std::move(alternative_colours),
/* Default to country colour for the chest and grey for the others. Update later if necessary. */
colour, default_colour, default_colour
});
diff --git a/src/openvic-simulation/country/Country.hpp b/src/openvic-simulation/country/Country.hpp
index 1d960c2..558b726 100644
--- a/src/openvic-simulation/country/Country.hpp
+++ b/src/openvic-simulation/country/Country.hpp
@@ -48,6 +48,7 @@ namespace OpenVic {
using government_colour_map_t = ordered_map<GovernmentType const*, colour_t>;
private:
+ const size_t PROPERTY(index);
GraphicalCultureType const& PROPERTY(graphical_culture);
/* Not const to allow elements to be moved, otherwise a copy is forced
* which causes a compile error as the copy constructor has been deleted. */
@@ -61,9 +62,9 @@ namespace OpenVic {
// Unit colours not const due to being added after construction
Country(
- std::string_view new_identifier, colour_t new_colour, GraphicalCultureType const& new_graphical_culture,
- IdentifierRegistry<CountryParty>&& new_parties, unit_names_map_t&& new_unit_names, bool new_dynamic_tag,
- government_colour_map_t&& new_alternative_colours,
+ std::string_view new_identifier, colour_t new_colour, size_t new_index,
+ GraphicalCultureType const& new_graphical_culture, IdentifierRegistry<CountryParty>&& new_parties,
+ unit_names_map_t&& new_unit_names, bool new_dynamic_tag, government_colour_map_t&& new_alternative_colours,
colour_t new_primary_unit_colour, colour_t new_secondary_unit_colour, colour_t new_tertiary_unit_colour
);