From 005a8026bb424779a146e00cc48621ff1d72b807 Mon Sep 17 00:00:00 2001 From: CptAlanSmith <123112708+CptAlanSmith@users.noreply.github.com> Date: Sat, 23 Sep 2023 19:25:15 +0100 Subject: 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 --- src/openvic-simulation/units/Unit.hpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/openvic-simulation/units/Unit.hpp') diff --git a/src/openvic-simulation/units/Unit.hpp b/src/openvic-simulation/units/Unit.hpp index c9d3434..507adbd 100644 --- a/src/openvic-simulation/units/Unit.hpp +++ b/src/openvic-simulation/units/Unit.hpp @@ -47,7 +47,7 @@ namespace OpenVic { protected: Unit(std::string_view identifier, std::string_view category, UNIT_PARAMS); - + public: Unit(Unit&&) = default; @@ -98,7 +98,7 @@ namespace OpenVic { struct NavalUnit : Unit { friend struct UnitManager; - + private: const icon_t naval_icon; const bool sail; @@ -144,18 +144,17 @@ namespace OpenVic { struct UnitManager { private: - GoodManager& good_manager; IdentifierRegistry units; bool _check_shared_parameters(const std::string_view identifier, UNIT_PARAMS); - + public: - UnitManager(GoodManager& good_manager); + UnitManager(); bool add_land_unit(const std::string_view identifier, UNIT_PARAMS, LAND_PARAMS); bool add_naval_unit(const std::string_view identifier, UNIT_PARAMS, NAVY_PARAMS); IDENTIFIER_REGISTRY_ACCESSORS(Unit, unit) - bool load_unit_file(ast::NodeCPtr root); + bool load_unit_file(GoodManager const& good_manager, ast::NodeCPtr root); }; } \ No newline at end of file -- cgit v1.2.3-56-ga3b1