diff --git a/Source/damage.hpp b/Source/damage.hpp index 705584fb8..4006bdc89 100644 --- a/Source/damage.hpp +++ b/Source/damage.hpp @@ -43,6 +43,20 @@ struct Damage { return !(*this == other); } + constexpr Damage operator+=(Damage damage) + { + minValue += damage.minValue; + maxValue += damage.maxValue; + return *this; + } + + constexpr Damage operator-=(Damage damage) + { + minValue -= damage.minValue; + maxValue -= damage.maxValue; + return *this; + } + constexpr Damage operator/=(const int factor) { minValue /= factor; @@ -50,6 +64,18 @@ struct Damage { return *this; } + constexpr friend Damage operator+(Damage damage, Damage anotherDamage) + { + damage += anotherDamage; + return damage; + } + + constexpr friend Damage operator-(Damage damage, Damage anotherDamage) + { + damage -= anotherDamage; + return damage; + } + constexpr friend Damage operator/(Damage damage, const int factor) { damage /= factor;