MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / resetResource

Method resetResource

source/game/StarStatCollection.cpp:110–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110void StatCollection::resetResource(String const& resourceName) {
111 m_stats.setResourceLocked(resourceName, false);
112 auto def = m_defaultResourceValues.get(resourceName);
113 if (def.isLeft())
114 m_stats.setResourceValue(resourceName, def.left());
115 else
116 m_stats.setResourcePercentage(resourceName, def.right());
117}
118
119void StatCollection::resetAllResources() {
120 for (auto const& resourceName : m_stats.resourceNames())

Callers 1

updateMethod · 0.45

Calls 7

isLeftMethod · 0.80
setResourceValueMethod · 0.80
leftMethod · 0.80
rightMethod · 0.80
setResourceLockedMethod · 0.45
getMethod · 0.45
setResourcePercentageMethod · 0.45

Tested by

no test coverage detected