aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/Modifier.cpp
diff options
context:
space:
mode:
author zaaarf <zaaarf@proton.me>2023-09-24 22:03:24 +0200
committer zaaarf <zaaarf@proton.me>2023-09-24 22:03:24 +0200
commitd34075e3cf78474a0203d3aedcb4df63f1159d46 (patch)
treeb8d1342ba6d9fa3f68221844618da932b5933629 /src/openvic-simulation/Modifier.cpp
parent5b0a02a1bd8caad21caa7d000173270d31df4201 (diff)
fix: fixed multiple compile-time warnings
Diffstat (limited to 'src/openvic-simulation/Modifier.cpp')
-rw-r--r--src/openvic-simulation/Modifier.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/openvic-simulation/Modifier.cpp b/src/openvic-simulation/Modifier.cpp
index 46bba48..7871692 100644
--- a/src/openvic-simulation/Modifier.cpp
+++ b/src/openvic-simulation/Modifier.cpp
@@ -71,13 +71,6 @@ ModifierValue ModifierValue::operator-(ModifierValue const& right) const {
return ret -= right;
}
-std::ostream& OpenVic::operator<<(std::ostream& stream, ModifierValue const& value) {
- for (ModifierValue::effect_map_t::value_type const& effect : value.values) {
- stream << effect.first << ": " << effect.second << "\n";
- }
- return stream;
-}
-
Modifier::Modifier(const std::string_view new_identifier, ModifierValue&& new_values, icon_t new_icon)
: HasIdentifier { new_identifier }, ModifierValue { std::move(new_values) }, icon { new_icon } {}
@@ -85,6 +78,8 @@ Modifier::icon_t Modifier::get_icon() const {
return icon;
}
+ModifierInstance::ModifierInstance(Modifier const& modifier, Date expiry_date) : modifier { modifier }, expiry_date { expiry_date } {}
+
Modifier const& ModifierInstance::get_modifier() const {
return modifier;
}
@@ -135,3 +130,12 @@ node_callback_t ModifierManager::expect_modifier_value(callback_t<ModifierValue&
return ret;
};
}
+
+namespace OpenVic { //so the compiler shuts up
+ std::ostream& operator<<(std::ostream& stream, ModifierValue const& value) {
+ for (ModifierValue::effect_map_t::value_type const& effect : value.values) {
+ stream << effect.first << ": " << effect.second << "\n";
+ }
+ return stream;
+ }
+} \ No newline at end of file