diff options
author | Hop311 <Hop3114@gmail.com> | 2024-10-31 21:50:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-31 21:50:36 +0100 |
commit | b602c10cf890c5973c1efbe8d958bf9b67499efe (patch) | |
tree | 3b34e78831ab11d6333ce2822b10244995a69848 /src/openvic-simulation/defines/GraphicsDefines.cpp | |
parent | 968c60580997d26035496cc675138e580354332f (diff) | |
parent | dbf58b1b1d318b4a82cf22b5b8e720c753388f4b (diff) |
Merge pull request #222 from OpenVicProject/defines-variables
Load defines directly into named and typed variables rather than using an IdentifierRegistry
Diffstat (limited to 'src/openvic-simulation/defines/GraphicsDefines.cpp')
-rw-r--r-- | src/openvic-simulation/defines/GraphicsDefines.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/openvic-simulation/defines/GraphicsDefines.cpp b/src/openvic-simulation/defines/GraphicsDefines.cpp new file mode 100644 index 0000000..e68afe2 --- /dev/null +++ b/src/openvic-simulation/defines/GraphicsDefines.cpp @@ -0,0 +1,41 @@ +#include "GraphicsDefines.hpp" + +using namespace OpenVic; +using namespace OpenVic::NodeTools; + +GraphicsDefines::GraphicsDefines() + : cities_sprawl_offset {}, + cities_sprawl_width {}, + cities_sprawl_height {}, + cities_sprawl_iterations {}, + cities_mesh_pool_size_for_country {}, + cities_mesh_pool_size_for_culture {}, + cities_mesh_pool_size_for_generic {}, + cities_mesh_types_count {}, + cities_mesh_sizes_count {}, + cities_special_buildings_pool_size {}, + cities_size_max_population_k {} {} + +std::string_view GraphicsDefines::get_name() const { + return "graphics"; +} + +node_callback_t GraphicsDefines::expect_defines() { + return expect_dictionary_keys( + "CITIES_SPRAWL_OFFSET", ONE_EXACTLY, expect_uint(assign_variable_callback(cities_sprawl_offset)), + "CITIES_SPRAWL_WIDTH", ONE_EXACTLY, expect_uint(assign_variable_callback(cities_sprawl_width)), + "CITIES_SPRAWL_HEIGHT", ONE_EXACTLY, expect_uint(assign_variable_callback(cities_sprawl_height)), + "CITIES_SPRAWL_ITERATIONS", ONE_EXACTLY, expect_uint(assign_variable_callback(cities_sprawl_iterations)), + "CITIES_MESH_POOL_SIZE_FOR_COUNTRY", ONE_EXACTLY, + expect_uint(assign_variable_callback(cities_mesh_pool_size_for_country)), + "CITIES_MESH_POOL_SIZE_FOR_CULTURE", ONE_EXACTLY, + expect_uint(assign_variable_callback(cities_mesh_pool_size_for_culture)), + "CITIES_MESH_POOL_SIZE_FOR_GENERIC", ONE_EXACTLY, + expect_uint(assign_variable_callback(cities_mesh_pool_size_for_generic)), + "CITIES_MESH_TYPES_COUNT", ONE_EXACTLY, expect_uint(assign_variable_callback(cities_mesh_types_count)), + "CITIES_MESH_SIZES_COUNT", ONE_EXACTLY, expect_uint(assign_variable_callback(cities_mesh_sizes_count)), + "CITIES_SPECIAL_BUILDINGS_POOL_SIZE", ONE_EXACTLY, + expect_uint(assign_variable_callback(cities_special_buildings_pool_size)), + "CITIES_SIZE_MAX_POPULATION_K", ONE_EXACTLY, expect_uint(assign_variable_callback(cities_size_max_population_k)) + ); +} |