diff options
author | Hop311 <Hop3114@gmail.com> | 2024-10-31 21:20:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-31 21:20:11 +0100 |
commit | 968c60580997d26035496cc675138e580354332f (patch) | |
tree | a0340ae5e92e219c5e0f5ddc825e28465f22a29e /src/openvic-simulation/scripts/ConditionalWeight.hpp | |
parent | c6f7c8047abbe0a91b2a88365eee2259d8a91a65 (diff) | |
parent | 84deeffe04d730064e89b4ceaf508f3f30113ea9 (diff) |
Merge pull request #218 from OpenVicProject/condition-scripts-prep-work
Condition scripts prep work
Diffstat (limited to 'src/openvic-simulation/scripts/ConditionalWeight.hpp')
-rw-r--r-- | src/openvic-simulation/scripts/ConditionalWeight.hpp | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/openvic-simulation/scripts/ConditionalWeight.hpp b/src/openvic-simulation/scripts/ConditionalWeight.hpp index c99d6b0..fcab0a6 100644 --- a/src/openvic-simulation/scripts/ConditionalWeight.hpp +++ b/src/openvic-simulation/scripts/ConditionalWeight.hpp @@ -14,32 +14,23 @@ namespace OpenVic { using condition_weight_item_t = std::variant<condition_weight_t, condition_weight_group_t>; enum class base_key_t : uint8_t { - BASE, FACTOR, MONTHS + BASE, FACTOR, TIME }; using enum base_key_t; private: fixed_point_t PROPERTY(base); std::vector<condition_weight_item_t> PROPERTY(condition_weight_items); - scope_t PROPERTY(initial_scope); - scope_t PROPERTY(this_scope); - scope_t PROPERTY(from_scope); + scope_type_t PROPERTY(initial_scope); + scope_type_t PROPERTY(this_scope); + scope_type_t PROPERTY(from_scope); struct parse_scripts_visitor_t; public: - ConditionalWeight(scope_t new_initial_scope, scope_t new_this_scope, scope_t new_from_scope); + ConditionalWeight(scope_type_t new_initial_scope, scope_type_t new_this_scope, scope_type_t new_from_scope); ConditionalWeight(ConditionalWeight&&) = default; - static constexpr std::string_view base_key_to_string(base_key_t base_key) { - switch (base_key) { - case base_key_t::BASE: return "base"; - case base_key_t::FACTOR: return "factor"; - case base_key_t::MONTHS: return "months"; // TODO - add functionality for days or months or years - default: return "INVALID BASE KEY"; - } - } - NodeTools::node_callback_t expect_conditional_weight(base_key_t base_key); bool parse_scripts(DefinitionManager const& definition_manager); |