diff options
Diffstat (limited to 'src/openvic-simulation/Modifier.cpp')
-rw-r--r-- | src/openvic-simulation/Modifier.cpp | 18 |
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 |