diff options
author | ClarkeCode <clarke.john.robert@gmail.com> | 2023-04-27 22:13:52 +0200 |
---|---|---|
committer | ClarkeCode <clarke.john.robert@gmail.com> | 2023-04-27 22:13:52 +0200 |
commit | 0b273743b480874281a8987c72b2f1b666bc289a (patch) | |
tree | 3f5d5a6316ac66407e61c8a56fe732cdf06209e5 /extension/src/Simulation.hpp | |
parent | 98dd680a641a2cbe0f1f93202a5beffdfd35c9f7 (diff) | |
parent | 10053cf259c55ee45803268a844edf1011d8a16b (diff) |
Merge branch 'main' of github.com:OpenVic2Project/OpenVic2 into goods
Diffstat (limited to 'extension/src/Simulation.hpp')
-rw-r--r-- | extension/src/Simulation.hpp | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/extension/src/Simulation.hpp b/extension/src/Simulation.hpp deleted file mode 100644 index 8959310..0000000 --- a/extension/src/Simulation.hpp +++ /dev/null @@ -1,52 +0,0 @@ -#pragma once - -#include <godot_cpp/classes/object.hpp> -#include <godot_cpp/core/class_db.hpp> -#include <godot_cpp/variant/utility_functions.hpp> -#include <vector> - -namespace OpenVic2 { - class Simulation : public godot::Object { - GDCLASS(Simulation, godot::Object) - std::vector<uint64_t> exampleProvinces; - - //BEGIN BOILERPLATE - static Simulation* _simulation; - - protected: - static void _bind_methods() { - godot::ClassDB::bind_method(godot::D_METHOD("conductSimulationStep"), &Simulation::conductSimulationStep); - godot::ClassDB::bind_method(godot::D_METHOD("queryProvinceSize"), &Simulation::queryProvinceSize); - } - - public: - inline static Simulation* get_singleton() { return _simulation; } - - inline Simulation() { - ERR_FAIL_COND(_simulation != nullptr); - _simulation = this; - - exampleProvinces.resize(10, 1); - } - inline ~Simulation() { - ERR_FAIL_COND(_simulation != this); - _simulation = nullptr; - } - //END BOILERPLATE - - inline void conductSimulationStep() { - for (uint64_t x = 0; x < exampleProvinces.size(); x++) { - exampleProvinces[x] += (x + 1); - } - } - - inline uint64_t queryProvinceSize(uint64_t provinceID) { - if (provinceID >= exampleProvinces.size()) { - return 0; - } - return exampleProvinces[provinceID]; - } - }; - - Simulation* Simulation::_simulation = nullptr; -} |