aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/modifier/ModifierEffect.cpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-09-30 22:10:01 +0200
committer hop311 <hop3114@gmail.com>2024-10-05 22:48:42 +0200
commitf3f364f08cc8f1c80a5dfce689183c2f8f75bbd4 (patch)
treec7c206ab58440bd8d5200c4416e97a324489d018 /src/openvic-simulation/modifier/ModifierEffect.cpp
parenteb77495ba874d474bbbbc950a65e8f496b13f285 (diff)
Move ModifierEffect and ModifierValue into their own files
Diffstat (limited to 'src/openvic-simulation/modifier/ModifierEffect.cpp')
-rw-r--r--src/openvic-simulation/modifier/ModifierEffect.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/openvic-simulation/modifier/ModifierEffect.cpp b/src/openvic-simulation/modifier/ModifierEffect.cpp
new file mode 100644
index 0000000..8daf563
--- /dev/null
+++ b/src/openvic-simulation/modifier/ModifierEffect.cpp
@@ -0,0 +1,17 @@
+#include "ModifierEffect.hpp"
+
+#include "openvic-simulation/utility/StringUtils.hpp"
+
+using namespace OpenVic;
+
+std::string ModifierEffect::make_default_modifier_effect_localisation_key(std::string_view identifier) {
+ return "MODIFIER_" + StringUtils::string_toupper(identifier);
+}
+
+ModifierEffect::ModifierEffect(
+ std::string_view new_identifier, bool new_positive_good, format_t new_format, target_t new_targets,
+ std::string_view new_localisation_key
+) : HasIdentifier { new_identifier }, positive_good { new_positive_good }, format { new_format }, targets { new_targets },
+ localisation_key {
+ new_localisation_key.empty() ? make_default_modifier_effect_localisation_key(new_identifier) : new_localisation_key
+ } {}