| 109 | } |
| 110 | |
| 111 | float StatSet::statEffectiveValue(String const& statName) const { |
| 112 | // All stat values will be added to m_effectiveStats regardless of whether a |
| 113 | // modifier is applied for it. |
| 114 | if (auto modified = m_effectiveStats.ptr(statName)) |
| 115 | return modified->effectiveModifiedValue; |
| 116 | else |
| 117 | return 0.0f; |
| 118 | } |
| 119 | |
| 120 | void StatSet::addResource(String resourceName, MVariant<String, float> max, MVariant<String, float> delta) { |
| 121 | auto pair = m_resources.insert({std::move(resourceName), Resource{std::move(max), std::move(delta), false, 0.0f, {}}}); |