aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/country
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-04-15 01:24:37 +0200
committer hop311 <hop3114@gmail.com>2024-04-15 01:24:37 +0200
commitb358fc0d4250178fbb44fc6b00cf4e39aa870064 (patch)
tree64f5ad5e2042dd0e2ebb4995b2e78de28af9f54e /src/openvic-simulation/country
parent8708e62d96fe298e1135538298172b6283bc56fb (diff)
Add default country unit coloursgfx-actor
Diffstat (limited to 'src/openvic-simulation/country')
-rw-r--r--src/openvic-simulation/country/Country.cpp15
-rw-r--r--src/openvic-simulation/country/Country.hpp3
2 files changed, 9 insertions, 9 deletions
diff --git a/src/openvic-simulation/country/Country.cpp b/src/openvic-simulation/country/Country.cpp
index 5ec4aee..0fdeb60 100644
--- a/src/openvic-simulation/country/Country.cpp
+++ b/src/openvic-simulation/country/Country.cpp
@@ -43,14 +43,12 @@ Country::Country(
alternative_colours { std::move(new_alternative_colours) },
primary_unit_colour { new_primary_unit_colour },
secondary_unit_colour { new_secondary_unit_colour },
- tertiary_unit_colour { new_tertiary_unit_colour }
- {}
+ tertiary_unit_colour { new_tertiary_unit_colour } {}
bool CountryManager::add_country(
std::string_view identifier, colour_t colour, GraphicalCultureType const* graphical_culture,
IdentifierRegistry<CountryParty>&& parties, Country::unit_names_map_t&& unit_names, bool dynamic_tag,
- Country::government_colour_map_t&& alternative_colours,
- colour_t primary_unit_colour, colour_t secondary_unit_colour, colour_t tertiary_unit_colour
+ Country::government_colour_map_t&& alternative_colours
) {
if (identifier.empty()) {
Logger::error("Invalid country identifier - empty!");
@@ -67,9 +65,13 @@ bool CountryManager::add_country(
return false;
}
+ 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), primary_unit_colour, secondary_unit_colour, tertiary_unit_colour
+ 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
});
}
@@ -205,8 +207,7 @@ bool CountryManager::load_country_data_file(
)(root);
ret &= add_country(
- name, colour, graphical_culture, std::move(parties), std::move(unit_names), is_dynamic,
- std::move(alternative_colours), colour_t::null(), colour_t::null(), colour_t::null()
+ name, colour, graphical_culture, std::move(parties), std::move(unit_names), is_dynamic, std::move(alternative_colours)
);
return ret;
}
diff --git a/src/openvic-simulation/country/Country.hpp b/src/openvic-simulation/country/Country.hpp
index ea8f732..1d960c2 100644
--- a/src/openvic-simulation/country/Country.hpp
+++ b/src/openvic-simulation/country/Country.hpp
@@ -85,8 +85,7 @@ namespace OpenVic {
bool add_country(
std::string_view identifier, colour_t colour, GraphicalCultureType const* graphical_culture,
IdentifierRegistry<CountryParty>&& parties, Country::unit_names_map_t&& unit_names, bool dynamic_tag,
- Country::government_colour_map_t&& alternative_colours,
- colour_t primary_unit_colour, colour_t secondary_unit_colour, colour_t tertiary_unit_colour
+ Country::government_colour_map_t&& alternative_colours
);
bool load_country_colours(ast::NodeCPtr root);