| 190 | } |
| 191 | |
| 192 | Maybe<float> StatSet::resourcePercentage(String const& resourceName) const { |
| 193 | auto const& resource = getResource(resourceName); |
| 194 | if (!resource.maxValue) |
| 195 | return {}; |
| 196 | return resource.value / *resource.maxValue; |
| 197 | } |
| 198 | |
| 199 | float StatSet::setResourcePercentage(String const& resourceName, float resourcePercentage) { |
| 200 | auto& resource = getResource(resourceName); |
no outgoing calls
no test coverage detected