diff options
author | Hop311 <Hop3114@gmail.com> | 2024-10-31 21:50:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-31 21:50:36 +0100 |
commit | b602c10cf890c5973c1efbe8d958bf9b67499efe (patch) | |
tree | 3b34e78831ab11d6333ce2822b10244995a69848 /src/openvic-simulation/defines/Define.hpp | |
parent | 968c60580997d26035496cc675138e580354332f (diff) | |
parent | dbf58b1b1d318b4a82cf22b5b8e720c753388f4b (diff) |
Merge pull request #222 from OpenVicProject/defines-variables
Load defines directly into named and typed variables rather than using an IdentifierRegistry
Diffstat (limited to 'src/openvic-simulation/defines/Define.hpp')
-rw-r--r-- | src/openvic-simulation/defines/Define.hpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/openvic-simulation/defines/Define.hpp b/src/openvic-simulation/defines/Define.hpp new file mode 100644 index 0000000..e1b2bc2 --- /dev/null +++ b/src/openvic-simulation/defines/Define.hpp @@ -0,0 +1,38 @@ +#pragma once + +#include "openvic-simulation/defines/AIDefines.hpp" +#include "openvic-simulation/defines/CountryDefines.hpp" +#include "openvic-simulation/defines/DiplomacyDefines.hpp" +#include "openvic-simulation/defines/EconomyDefines.hpp" +#include "openvic-simulation/defines/GraphicsDefines.hpp" +#include "openvic-simulation/defines/MilitaryDefines.hpp" +#include "openvic-simulation/defines/PopsDefines.hpp" +#include "openvic-simulation/types/Date.hpp" +#include "openvic-simulation/utility/Getters.hpp" + +namespace OpenVic { + struct DefineManager { + private: + // Date + Date PROPERTY(start_date); + Date PROPERTY(end_date); + + // Other define groups + AIDefines PROPERTY(ai_defines); + CountryDefines PROPERTY(country_defines); + DiplomacyDefines PROPERTY(diplomacy_defines); + EconomyDefines PROPERTY(economy_defines); + GraphicsDefines PROPERTY(graphics_defines); + MilitaryDefines PROPERTY(military_defines); + PopsDefines PROPERTY(pops_defines); + + public: + DefineManager(); + + constexpr bool in_game_period(Date date) const { + return date.in_range(start_date, end_date); + } + + bool load_defines_file(ast::NodeCPtr root); + }; +} |