aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/economy
diff options
context:
space:
mode:
author Spartan322 <Megacake1234@gmail.com>2023-12-25 08:42:11 +0100
committer Spartan322 <Megacake1234@gmail.com>2023-12-31 20:46:26 +0100
commite1496a87178d925277aceed0ebcbab06920e15ee (patch)
treeba081f9f4d74865ab5851a2efd560745900ca81a /src/openvic-simulation/economy
parent0a425fbe05d6138b753c0e4a7c06f06695bde8af (diff)
Add `https://github.com/Tessil/ordered-map`
Add is_specialization_of to Utility.hpp Add OpenVic::ordered_map and OpenVic::ordered_set Change `std::map` to `ordered_map` Change `std::set to use `ordered_set` Add `set_callback_pointer(tsl::ordered_set<T const*>& set)` Add mutable_iterator to enable mutable value iterator for `tsl::ordered_map` Add std::hash<OpenVic::Date> implementation Enable deps/SCsub to expose dependency includes neccessary for inclusion
Diffstat (limited to 'src/openvic-simulation/economy')
-rw-r--r--src/openvic-simulation/economy/ProductionType.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/openvic-simulation/economy/ProductionType.cpp b/src/openvic-simulation/economy/ProductionType.cpp
index 05529f5..f0ad6ea 100644
--- a/src/openvic-simulation/economy/ProductionType.cpp
+++ b/src/openvic-simulation/economy/ProductionType.cpp
@@ -1,5 +1,7 @@
#include "ProductionType.hpp"
+#include "openvic-simulation/types/OrderedContainers.hpp"
+
using namespace OpenVic;
using namespace OpenVic::NodeTools;
@@ -130,8 +132,8 @@ bool ProductionTypeManager::load_production_types_file(
size_t expected_types = 0;
// pass 1: find and store template identifiers
- std::set<std::string_view> templates;
- std::map<std::string_view, std::string_view> template_target_map;
+ ordered_set<std::string_view> templates;
+ ordered_map<std::string_view, std::string_view> template_target_map;
bool ret = expect_dictionary(
[this, &expected_types, &templates, &template_target_map](std::string_view key, ast::NodeCPtr value) -> bool {
expected_types++;
@@ -154,7 +156,7 @@ bool ProductionTypeManager::load_production_types_file(
)(root);
// pass 2: create and populate the template map
- std::map<std::string_view, ast::NodeCPtr> template_node_map;
+ ordered_map<std::string_view, ast::NodeCPtr> template_node_map;
ret &= expect_dictionary(
[this, &expected_types, &templates, &template_node_map](std::string_view key, ast::NodeCPtr value) -> bool {
if (templates.contains(key)) {