aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/country
diff options
context:
space:
mode:
author zaaarf <me@zaaarf.foo>2023-12-10 23:15:41 +0100
committer zaaarf <me@zaaarf.foo>2023-12-10 23:15:41 +0100
commit4ef33d4df6198e613b0f27406d49978c8ea2fb97 (patch)
tree7f07835485b877f3c01c52c188892499e5812f9b /src/openvic-simulation/country
parent1eb28bd4fb959b69a30013f6438f0257a2ee7b03 (diff)
feat: improved identifier registry macro
Diffstat (limited to 'src/openvic-simulation/country')
-rw-r--r--src/openvic-simulation/country/Country.cpp2
-rw-r--r--src/openvic-simulation/country/Country.hpp9
2 files changed, 2 insertions, 9 deletions
diff --git a/src/openvic-simulation/country/Country.cpp b/src/openvic-simulation/country/Country.cpp
index 935c409..cb4de8a 100644
--- a/src/openvic-simulation/country/Country.cpp
+++ b/src/openvic-simulation/country/Country.cpp
@@ -35,8 +35,6 @@ Country::Country(
parties { std::move(new_parties) }, unit_names { std::move(new_unit_names) }, dynamic_tag { new_dynamic_tag },
alternative_colours { std::move(new_alternative_colours) } {}
-CountryManager::CountryManager() : countries { "countries" } {}
-
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,
diff --git a/src/openvic-simulation/country/Country.hpp b/src/openvic-simulation/country/Country.hpp
index 5d25b33..c35cf4f 100644
--- a/src/openvic-simulation/country/Country.hpp
+++ b/src/openvic-simulation/country/Country.hpp
@@ -58,7 +58,7 @@ namespace OpenVic {
/* 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.
*/
- IdentifierRegistry<CountryParty> parties;
+ IdentifierRegistry<CountryParty> IDENTIFIER_REGISTRY_CUSTOM_PLURAL(party, parties);
const unit_names_map_t PROPERTY(unit_names);
const bool PROPERTY_CUSTOM_PREFIX(dynamic_tag, is);
const government_colour_map_t PROPERTY(alternative_colours);
@@ -72,28 +72,23 @@ namespace OpenVic {
public:
Country(Country&&) = default;
- IDENTIFIER_REGISTRY_ACCESSORS_CUSTOM_PLURAL(party, parties)
-
// TODO - get_colour including alternative colours
};
struct CountryManager {
private:
- IdentifierRegistry<Country> countries;
+ IdentifierRegistry<Country> IDENTIFIER_REGISTRY_CUSTOM_PLURAL(country, countries);
NodeTools::node_callback_t load_country_party(
PoliticsManager const& politics_manager, IdentifierRegistry<CountryParty>& country_parties
) const;
public:
- CountryManager();
-
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
);
- IDENTIFIER_REGISTRY_ACCESSORS_CUSTOM_PLURAL(country, countries)
bool load_countries(GameManager const& game_manager, Dataloader const& dataloader, ast::NodeCPtr root);
bool load_country_data_file(