aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/research/Technology.hpp
diff options
context:
space:
mode:
author Conor <conoboy137@hotmail.co.uk>2024-03-02 02:22:43 +0100
committer GitHub <noreply@github.com>2024-03-02 02:22:43 +0100
commit2c892c99a6647be15ef23cabf6cc40f08769283d (patch)
tree87613ee327ddfbc8bbcc1c3ebf725837d0b724bf /src/openvic-simulation/research/Technology.hpp
parentc44e76b4f340bb9e667dca7afd7468c78b9de967 (diff)
parent35c6417af51e919194043af65870420656f48ae3 (diff)
Merge pull request #151 from OpenVicProject/tech-improvements
Cleaned up tech loading and added tech lists for areas
Diffstat (limited to 'src/openvic-simulation/research/Technology.hpp')
-rw-r--r--src/openvic-simulation/research/Technology.hpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/openvic-simulation/research/Technology.hpp b/src/openvic-simulation/research/Technology.hpp
index a4287a5..aa47301 100644
--- a/src/openvic-simulation/research/Technology.hpp
+++ b/src/openvic-simulation/research/Technology.hpp
@@ -10,21 +10,28 @@
#include "openvic-simulation/types/OrderedContainers.hpp"
namespace OpenVic {
+ struct TechnologyArea;
+
struct TechnologyFolder : HasIdentifier {
friend struct TechnologyManager;
private:
+ std::vector<TechnologyArea const*> PROPERTY(technology_areas);
+
TechnologyFolder(std::string_view new_identifier);
public:
TechnologyFolder(TechnologyFolder&&) = default;
};
+ struct Technology;
+
struct TechnologyArea : HasIdentifier {
friend struct TechnologyManager;
private:
TechnologyFolder const& PROPERTY(folder);
+ std::vector<Technology const*> PROPERTY(technologies);
TechnologyArea(std::string_view new_identifier, TechnologyFolder const& new_folder);
@@ -86,14 +93,22 @@ namespace OpenVic {
bool add_technology_school(std::string_view identifier, ModifierValue&& values);
- bool load_technology_file_areas(ast::NodeCPtr root); // common/technology.txt
- bool load_technology_file_schools(ModifierManager const& modifier_manager, ast::NodeCPtr root); // also common/technology.txt
+ /* Both of these functions load data from "common/technology.txt", they are separated because the schools depend
+ * on modifiers generated from the folder definitions and so loading must be staggered. */
+ bool load_technology_file_folders_and_areas(ast::NodeCPtr root);
+ bool load_technology_file_schools(ModifierManager const& modifier_manager, ast::NodeCPtr root);
+
+ /* Loaded from "technologies/.txt" files named after technology folders. */
bool load_technologies_file(
ModifierManager const& modifier_manager, UnitManager const& unit_manager,
BuildingTypeManager const& building_type_manager, ast::NodeCPtr root
- ); // technologies/*.txt
+ );
+
bool generate_modifiers(ModifierManager& modifier_manager) const;
+ /* Populates the lists of technology areas for each technology folder and technologies for each technology area. */
+ bool generate_technology_lists();
+
bool parse_scripts(GameManager const& game_manager);
};
} \ No newline at end of file