diff options
author | CptAlanSmith <123112708+CptAlanSmith@users.noreply.github.com> | 2023-09-23 20:25:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-23 20:25:15 +0200 |
commit | 005a8026bb424779a146e00cc48621ff1d72b807 (patch) | |
tree | dde15211e31d861b61711bf6aebdeb8713393d53 /src/openvic-simulation/economy | |
parent | ebea2e473eefa3945508b0bf622a472b62d70d3b (diff) |
Testing (#23)
* Fixes for building scons
* Initial proof of concept auto-testing
Shows how we can pull loaded data and display it back
* Re-did headless
Because hubert insisted it be done like this ;)
* Auto-Testing Framework Basics
* Requirements Calculations
* Fix for messy merge (teach me to use merge tools)
* Fixing up misc merge issues to fully reconcile with master changes
* Re-added missing getters
* Move of testing files due to folder reorgs
* Use new accessors + int reading fix
---------
Co-authored-by: Hop311 <hop3114@gmail.com>
Diffstat (limited to 'src/openvic-simulation/economy')
-rw-r--r-- | src/openvic-simulation/economy/Good.cpp | 17 | ||||
-rw-r--r-- | src/openvic-simulation/economy/Good.hpp | 4 |
2 files changed, 0 insertions, 21 deletions
diff --git a/src/openvic-simulation/economy/Good.cpp b/src/openvic-simulation/economy/Good.cpp index 027fb5f..943db00 100644 --- a/src/openvic-simulation/economy/Good.cpp +++ b/src/openvic-simulation/economy/Good.cpp @@ -3,9 +3,6 @@ #include <cassert> #include <map> #include <string_view> -#include "dataloader/NodeTools.hpp" -#include "openvic-dataloader/v2script/AbstractSyntaxTree.hpp" -#include "types/fixed_point/FixedPoint.hpp" using namespace OpenVic; using namespace OpenVic::NodeTools; @@ -137,17 +134,3 @@ bool GoodManager::load_goods_file(ast::NodeCPtr root) { lock_goods(); return ret; } - -node_callback_t GoodManager::expect_goods_map(callback_t<std::map<Good const*, fixed_point_t>> cb) { - return [this, cb](ast::NodeCPtr node) -> bool { - std::map<Good const*, fixed_point_t> goods_map; - bool res = expect_good_dictionary([&goods_map](const Good & key, ast::NodeCPtr value) -> bool { - fixed_point_t good_value; - bool res = expect_fixed_point((assign_variable_callback(good_value)))(value); - goods_map.emplace(&key, good_value); - return res; - })(node); - res &= cb(goods_map); - return res; - }; -}
\ No newline at end of file diff --git a/src/openvic-simulation/economy/Good.hpp b/src/openvic-simulation/economy/Good.hpp index df92525..792336d 100644 --- a/src/openvic-simulation/economy/Good.hpp +++ b/src/openvic-simulation/economy/Good.hpp @@ -1,8 +1,6 @@ #pragma once -#include "openvic-simulation/dataloader/NodeTools.hpp" #include "openvic-simulation/types/IdentifierRegistry.hpp" -#include "openvic-dataloader/v2script/AbstractSyntaxTree.hpp" namespace OpenVic { struct GoodManager; @@ -76,7 +74,5 @@ namespace OpenVic { void reset_to_defaults(); bool load_goods_file(ast::NodeCPtr root); - - NodeTools::node_callback_t expect_goods_map(NodeTools::callback_t<std::map<Good const*, fixed_point_t>> cb); }; } |